1 |
/* |
/* |
2 |
* Copyright (C) 2003-2005 Anders Gavare. All rights reserved. |
* Copyright (C) 2003-2006 Anders Gavare. All rights reserved. |
3 |
* |
* |
4 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
5 |
* modification, are permitted provided that the following conditions are met: |
* modification, are permitted provided that the following conditions are met: |
25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: symbol.c,v 1.33 2005/10/26 14:37:02 debug Exp $ |
* $Id: symbol.c,v 1.36 2006/07/07 19:38:55 debug Exp $ |
29 |
* |
* |
30 |
* Address to symbol translation routines. |
* Address to symbol translation routines. |
31 |
* |
* |
37 |
#include <stdlib.h> |
#include <stdlib.h> |
38 |
#include <string.h> |
#include <string.h> |
39 |
|
|
|
#include "misc.h" |
|
|
|
|
40 |
#include "symbol.h" |
#include "symbol.h" |
41 |
|
|
42 |
|
|
224 |
exit(1); |
exit(1); |
225 |
} |
} |
226 |
|
|
227 |
|
if (addr == 0 && strcmp(name, "_DYNAMIC_LINK") == 0) |
228 |
|
return; |
229 |
|
|
230 |
if (name[0] == '\0') |
if (name[0] == '\0') |
231 |
return; |
return; |
232 |
|
|
269 |
exit(1); |
exit(1); |
270 |
} |
} |
271 |
|
|
272 |
s->name = strdup(name); |
memset(s, 0, sizeof(struct symbol)); |
273 |
|
|
274 |
|
s->name = symbol_demangle_cplusplus(name); |
275 |
|
|
276 |
if (s->name == NULL) { |
if (s->name == NULL) { |
277 |
fprintf(stderr, "out of memory\n"); |
s->name = strdup(name); |
278 |
exit(1); |
if (s->name == NULL) { |
279 |
|
fprintf(stderr, "out of memory\n"); |
280 |
|
exit(1); |
281 |
|
} |
282 |
} |
} |
283 |
|
|
284 |
s->addr = addr; |
s->addr = addr; |
285 |
s->len = len; |
s->len = len; |
286 |
s->type = type; |
s->type = type; |