aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tiemann <tiemann@cygnus>1992-01-20 16:55:45 +0000
committerMichael Tiemann <tiemann@cygnus>1992-01-20 16:55:45 +0000
commit0eb0a82097beda29e9face374bf45205a8748b9e (patch)
tree429e8e399c2f38d7806cf32da0ad056b0fc59a6e
parentf3139e9366c9264adeeb7236cf3533eb8b89a911 (diff)
downloadgdb-0eb0a82097beda29e9face374bf45205a8748b9e.zip
gdb-0eb0a82097beda29e9face374bf45205a8748b9e.tar.gz
gdb-0eb0a82097beda29e9face374bf45205a8748b9e.tar.bz2
Fix demangling of destructors, and fix a minor indentation problem.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/buildsym.c2
-rw-r--r--gdb/cplus-dem.c17
3 files changed, 18 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ae583ed..12ce372 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+Mon Jan 20 08:54:00 1992 Michael Tiemann (tiemann at cygnus.com)
+
+ * cplus-dem.c (cplus_demangle): Correctly demangle destructors.
+
Sat Jan 18 17:17:45 1992 Stu Grossman (grossman at cygnus.com)
* Makefile.in (HFILES): Add partial-stab.h.
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 37baacd..ae1d9f9 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -2461,7 +2461,7 @@ read_struct_type (pp, type)
if (nfn_fields)
{
- TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
+ TYPE_FN_FIELDLISTS (type) = (struct fn_fieldlist *)
obstack_alloc (symbol_obstack,
sizeof (struct fn_fieldlist) * nfn_fields);
TYPE_NFN_FIELDS (type) = nfn_fields;
diff --git a/gdb/cplus-dem.c b/gdb/cplus-dem.c
index e58a955..626b756 100644
--- a/gdb/cplus-dem.c
+++ b/gdb/cplus-dem.c
@@ -290,11 +290,20 @@ cplus_demangle (type, arg_mode)
/* destructor */
if (type[0] == '_' && type[1] == CPLUS_MARKER && type[2] == '_')
{
- int n = (strlen (type) - 3)*2 + 3 + 2 + 1;
- char *tem = (char *) xmalloc (n);
- strcpy (tem, type + 3);
+ int n;
+ char *tem;
+
+ type += 3; /* Get past _$_ at front. */
+ while (isdigit (*type))
+ /* If there are digits at the front, it's because
+ of new 2.0 name mangling. Just skip them. */
+ type++;
+
+ n = strlen (type)*2 + 3 + 2 + 1;
+ tem = (char *) xmalloc (n);
+ strcpy (tem, type);
strcat (tem, "::~");
- strcat (tem, type + 3);
+ strcat (tem, type);
if (print_arg_types)
strcat (tem, "()");
return tem;