diff options
author | Juan Cespedes <cespedes@debian.org> | 2004-11-10 00:15:33 +0100 |
---|---|---|
committer | Juan Cespedes <cespedes@debian.org> | 2004-11-10 00:15:33 +0100 |
commit | d914a206a11cc1011a45f00674b1e16988fae77f (patch) | |
tree | 77b4ecf3d7c51911e04566cce1c2319715448faf /demangle.c | |
parent | 337ea4581657020f6e9ae93e30cb4a7ddd993903 (diff) | |
download | ltrace-d914a206a11cc1011a45f00674b1e16988fae77f.tar.gz |
Version: 0.3.36
* Fixed "--indent" option
* Got rid of Debian and RedHat specific parts in tarball
Diffstat (limited to 'demangle.c')
-rw-r--r-- | demangle.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -2,8 +2,6 @@ #include "config.h" #endif -#if HAVE_LIBIBERTY - #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -14,6 +12,8 @@ #include "dict.h" +#ifdef USE_DEMANGLE + /*****************************************************************************/ static struct dict * d = NULL; @@ -27,6 +27,10 @@ my_demangle_dict_clear(void) { const char * my_demangle(const char * function_name) { const char * tmp, * fn_copy; +#if !defined HAVE_LIBIBERTY && defined HAVE_LIBSUPC__ + extern char *__cxa_demangle (const char *, char *, size_t *, int *); + int status = 0; +#endif if (!d) { d = dict_init(dict_key2hash_string, dict_key_cmp_string); @@ -36,7 +40,11 @@ my_demangle(const char * function_name) { tmp = dict_find_entry(d, (void *)function_name); if (!tmp) { fn_copy = strdup(function_name); - tmp = cplus_demangle(function_name+strspn(function_name, "_"), DMGL_ANSI | DMGL_PARAMS); +#ifdef HAVE_LIBIBERTY + tmp = cplus_demangle(function_name, DMGL_ANSI | DMGL_PARAMS); +#elif defined HAVE_LIBSUPC__ + tmp = __cxa_demangle(function_name, NULL, NULL, &status); +#endif if (!tmp) tmp = fn_copy; if (tmp) dict_enter(d, (void *)fn_copy, (void *)tmp); } |