aboutsummaryrefslogtreecommitdiff
path: root/binutils/stabs.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2019-01-07 18:05:36 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2019-01-07 18:06:35 -0500
commit4ae80ffc55cd44fe9a5527403f07fee70307b2d7 (patch)
tree9dba1ab3b1a201fb9def27373de916455325709a /binutils/stabs.c
parent053af8c9034f92d6e36a1180655ba22a65c56437 (diff)
downloadgdb-4ae80ffc55cd44fe9a5527403f07fee70307b2d7.zip
gdb-4ae80ffc55cd44fe9a5527403f07fee70307b2d7.tar.gz
gdb-4ae80ffc55cd44fe9a5527403f07fee70307b2d7.tar.bz2
Revert "Sync libiberty sources with master version in gcc repository. Updated stabs demangling and cxxfilt tests to match."
The previous commit breaks the GDB build, which is still using functions cplus_demangle_opname & co. Since removing these usages is not an obvious fix, let's revert this patch until we get rid of them.
Diffstat (limited to 'binutils/stabs.c')
-rw-r--r--binutils/stabs.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/binutils/stabs.c b/binutils/stabs.c
index e84aa6f..18788b9 100644
--- a/binutils/stabs.c
+++ b/binutils/stabs.c
@@ -3037,15 +3037,27 @@ parse_stab_argtypes (void *dhandle, struct stab_handle *info,
&& fieldname[1] == 'p'
&& (fieldname[2] == '$' || fieldname[2] == '.'))
{
- /* Opname selection is no longer supported by libiberty's demangler. */
- return DEBUG_TYPE_NULL;
- }
+ const char *opname;
- physname = (char *) xmalloc (mangled_name_len);
- if (is_constructor)
- physname[0] = '\0';
+ opname = cplus_mangle_opname (fieldname + 3, 0);
+ if (opname == NULL)
+ {
+ fprintf (stderr, _("No mangling for \"%s\"\n"), fieldname);
+ return DEBUG_TYPE_NULL;
+ }
+ mangled_name_len += strlen (opname);
+ physname = (char *) xmalloc (mangled_name_len);
+ strncpy (physname, fieldname, 3);
+ strcpy (physname + 3, opname);
+ }
else
- strcpy (physname, fieldname);
+ {
+ physname = (char *) xmalloc (mangled_name_len);
+ if (is_constructor)
+ physname[0] = '\0';
+ else
+ strcpy (physname, fieldname);
+ }
physname_len = strlen (physname);
strcat (physname, buf);