mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-16 20:32:21 +08:00
* ldmisc.c (demangle): Restore dots stripped from sym name.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2002-06-26 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* ldmisc.c (demangle): Restore dots stripped from sym name.
|
||||||
|
|
||||||
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.
|
||||||
|
22
ld/ldmisc.c
22
ld/ldmisc.c
@ -78,13 +78,31 @@ demangle (string)
|
|||||||
|
|
||||||
/* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
|
/* This is a hack for better error reporting on XCOFF, PowerPC64-ELF
|
||||||
or the MS PE format. These formats have a number of leading '.'s
|
or the MS PE format. These formats have a number of leading '.'s
|
||||||
on at least some symbols, so we remove all dots. */
|
on at least some symbols, so we remove all dots to avoid
|
||||||
|
confusing the demangler. */
|
||||||
p = string;
|
p = string;
|
||||||
while (*p == '.')
|
while (*p == '.')
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS);
|
res = cplus_demangle (p, DMGL_ANSI | DMGL_PARAMS);
|
||||||
return res ? res : xstrdup (string);
|
if (res)
|
||||||
|
{
|
||||||
|
size_t dots = p - string;
|
||||||
|
|
||||||
|
/* Now put back any stripped dots. */
|
||||||
|
if (dots != 0)
|
||||||
|
{
|
||||||
|
size_t len = strlen (res) + 1;
|
||||||
|
char *add_dots = xmalloc (len + dots);
|
||||||
|
|
||||||
|
memcpy (add_dots, string, dots);
|
||||||
|
memcpy (add_dots + dots, res, len);
|
||||||
|
free (res);
|
||||||
|
res = add_dots;
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
return xstrdup (string);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user