symbol.cc Source File
Back to the index.
Go to the documentation of this file.
41 #define SYMBOLBUF_MAX 100
111 uint64_t *offset,
int *n_argsp)
118 if ((
addr >> 32) == 0 && (
addr & 0x80000000ULL))
119 addr |= 0xffffffff00000000ULL;
136 "%s+0x%" PRIx64, s->
name, (uint64_t)
148 int lowest = 0, highest = sc->
n_symbols - 1;
149 while (lowest <= highest) {
150 int ofs = (lowest + highest) / 2;
160 "%s+0x%" PRIx64, s->
name, (uint64_t)
205 fprintf(stderr,
"add_symbol_name(): Internal error: the "
206 "symbol array is already sorted\n");
211 fprintf(stderr,
"add_symbol_name(): name = NULL\n");
215 if (
addr == 0 && strcmp(
name,
"_DYNAMIC_LINK") == 0)
222 if (
name[0] ==
'.' ||
name[0] ==
'$')
227 if (strcmp(
name,
"strlen") == 0)
229 if (strcmp(
name,
"strcmp") == 0)
231 if (strcmp(
name,
"strcpy") == 0)
233 if (strcmp(
name,
"strncpy") == 0)
235 if (strcmp(
name,
"strlcpy") == 0)
237 if (strcmp(
name,
"strlcat") == 0)
239 if (strcmp(
name,
"strncmp") == 0)
241 if (strcmp(
name,
"memset") == 0)
243 if (strcmp(
name,
"memcpy") == 0)
245 if (strcmp(
name,
"bzero") == 0)
247 if (strcmp(
name,
"bcopy") == 0)
251 if ((
addr >> 32) == 0 && (
addr & 0x80000000ULL))
252 addr |= 0xffffffff00000000ULL;
255 memset(s, 0,
sizeof(
struct symbol));
287 char b1[80]; uint64_t
addr;
288 char b2[80]; uint64_t
len;
289 char b3[80];
int type;
293 f = fopen(fname,
"r");
300 memset(b1, 0,
sizeof(b1));
301 memset(b2, 0,
sizeof(b2));
302 memset(b3, 0,
sizeof(b3));
303 memset(b4, 0,
sizeof(b4));
304 if (fscanf(
f,
"%s %s\n", b1,b2) != 2)
305 fprintf(stderr,
"warning: symbol file parse error\n");
306 if (
strlen(b2) < 2 && !(b2[0]>=
'0' && b2[0]<=
'9')) {
307 strlcpy(b3, b2,
sizeof(b3));
308 strlcpy(b2,
"0",
sizeof(b2));
309 if (fscanf(
f,
"%s\n", b4) != 1)
310 fprintf(stderr,
"warning: symbol file parse error\n");
312 if (fscanf(
f,
"%s %s\n", b3,b4) != 2)
313 fprintf(stderr,
"warning: symbol file parse error\n");
318 addr = strtoull(b1, NULL, 16);
319 len = strtoull(b2, NULL, 16);
376 while (tmp_ptr != NULL) {
377 tmp_array[i] = *tmp_ptr;
379 tmp_ptr = tmp_ptr->
next;
392 if (tmp_array[i].
len == 0) {
403 tmp_array[i].
next = &tmp_array[i+1];
struct symbol * first_symbol
void f(int s, int func, int only_name)
int symbol_nsymbols(struct symbol_context *sc)
void symbol_readfile(struct symbol_context *sc, char *fname)
char * get_symbol_name_and_n_args(struct symbol_context *sc, uint64_t addr, uint64_t *offset, int *n_argsp)
char * get_symbol_name(struct symbol_context *sc, uint64_t addr, uint64_t *offs)
void add_symbol_name(struct symbol_context *sc, uint64_t addr, uint64_t len, const char *name, int type, int n_args)
void COMBINE() strlen(struct cpu *cpu, struct arm_instr_call *ic, int low_addr)
char * symbol_demangle_cplusplus(const char *name)
int sym_addr_compare(const void *a, const void *b)
void symbol_init(struct symbol_context *sc)
void symbol_recalc_sizes(struct symbol_context *sc)
int get_symbol_addr(struct symbol_context *sc, const char *symbol, uint64_t *addr)
#define CHECK_ALLOCATION(ptr)
Generated on Tue Aug 25 2020 19:25:06 for GXemul by
1.8.18