25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: symbol.c,v 1.38 2007/04/22 14:32:01 debug Exp $ |
* $Id: symbol.c,v 1.39 2007/06/15 17:02:38 debug Exp $ |
29 |
* |
* |
30 |
* Address to symbol translation routines. |
* Address to symbol translation routines. |
31 |
* |
* |
253 |
if ((addr >> 32) == 0 && (addr & 0x80000000ULL)) |
if ((addr >> 32) == 0 && (addr & 0x80000000ULL)) |
254 |
addr |= 0xffffffff00000000ULL; |
addr |= 0xffffffff00000000ULL; |
255 |
|
|
256 |
s = malloc(sizeof(struct symbol)); |
CHECK_ALLOCATION(s = malloc(sizeof(struct symbol))); |
|
if (s == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
|
|
|
257 |
memset(s, 0, sizeof(struct symbol)); |
memset(s, 0, sizeof(struct symbol)); |
258 |
|
|
259 |
s->name = symbol_demangle_cplusplus(name); |
s->name = symbol_demangle_cplusplus(name); |
260 |
|
|
261 |
if (s->name == NULL) { |
if (s->name == NULL) |
262 |
s->name = strdup(name); |
CHECK_ALLOCATION(s->name = strdup(name)); |
|
if (s->name == NULL) { |
|
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
263 |
|
|
264 |
s->addr = addr; |
s->addr = addr; |
265 |
s->len = len; |
s->len = len; |
365 |
struct symbol *tmp_ptr; |
struct symbol *tmp_ptr; |
366 |
int i; |
int i; |
367 |
|
|
368 |
tmp_array = malloc(sizeof (struct symbol) * sc->n_symbols); |
CHECK_ALLOCATION(tmp_array = malloc(sizeof (struct symbol) * |
369 |
if (tmp_array == NULL) { |
sc->n_symbols)); |
|
fprintf(stderr, "out of memory\n"); |
|
|
exit(1); |
|
|
} |
|
370 |
|
|
371 |
/* Copy first_symbol --> tmp_array, and remove the old |
/* Copy first_symbol --> tmp_array, and remove the old |
372 |
first_symbol at the same time: */ |
first_symbol at the same time: */ |