mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 14:39:09 +08:00
* nm.c (print_symname): When demangling, strip leading dots from
symbol names to avoid confusing the demangler.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2002-06-26 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* nm.c (print_symname): When demangling, strip leading dots from
|
||||||
|
symbol names to avoid confusing the demangler.
|
||||||
|
|
||||||
2002-06-25 H.J. Lu <hjl@gnu.org>
|
2002-06-25 H.J. Lu <hjl@gnu.org>
|
||||||
|
|
||||||
* Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it.
|
* Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it.
|
||||||
|
@ -1086,6 +1086,7 @@ print_symname (format, name, abfd)
|
|||||||
if (do_demangle && *name)
|
if (do_demangle && *name)
|
||||||
{
|
{
|
||||||
char *res;
|
char *res;
|
||||||
|
const char *p;
|
||||||
|
|
||||||
/* In this mode, give a user-level view of the symbol name
|
/* In this mode, give a user-level view of the symbol name
|
||||||
even if it's not mangled; strip off any leading
|
even if it's not mangled; strip off any leading
|
||||||
@ -1093,9 +1094,30 @@ print_symname (format, name, abfd)
|
|||||||
if (bfd_get_symbol_leading_char (abfd) == name[0])
|
if (bfd_get_symbol_leading_char (abfd) == name[0])
|
||||||
name++;
|
name++;
|
||||||
|
|
||||||
res = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
|
/* This is a hack for XCOFF, PowerPC64-ELF or the MS PE format.
|
||||||
|
These formats have a number of leading '.'s on at least some
|
||||||
|
symbols, so we remove all dots to avoid confusing the
|
||||||
|
demangler. */
|
||||||
|
p = name;
|
||||||
|
while (*p == '.')
|
||||||
|
++p;
|
||||||
|
|
||||||
|
res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
|
size_t dots = p - name;
|
||||||
|
|
||||||
|
/* Now put back any stripped dots. */
|
||||||
|
if (dots != 0)
|
||||||
|
{
|
||||||
|
size_t len = strlen (res) + 1;
|
||||||
|
char *add_dots = xmalloc (len + dots);
|
||||||
|
|
||||||
|
memcpy (add_dots, name, dots);
|
||||||
|
memcpy (add_dots + dots, res, len);
|
||||||
|
free (res);
|
||||||
|
res = add_dots;
|
||||||
|
}
|
||||||
printf (format, res);
|
printf (format, res);
|
||||||
free (res);
|
free (res);
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user