diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2014-10-15 19:28:19 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2014-10-15 19:28:19 +0100 |
commit | 35a49624e2eda82351518e40d26d6deb86fdacc0 (patch) | |
tree | 799fdbff515fd376b466158e75cf1cf04b2e489c /gdb/d-lang.c | |
parent | 8fa0c4f8ed9e520c39132bc62d51a490a17c537f (diff) | |
download | gdb-35a49624e2eda82351518e40d26d6deb86fdacc0.zip gdb-35a49624e2eda82351518e40d26d6deb86fdacc0.tar.gz gdb-35a49624e2eda82351518e40d26d6deb86fdacc0.tar.bz2 |
Remove d-support.c and use gdb_demangle for demangling D symbols.
gdb/ChangeLog
* Makefile.in (SFILES): Remove d-support.c.
(COMMON_OBS): Remove d-support.o.
* d-lang.h (d_parse_symbol): Remove declaration.
* d-lang.c (d_demangle): Use gdb_demangle to demangle D symbols.
* d-support.c: Remove file.
gdb/testsuite/ChangeLog
* gdb.dlang/demangle.exp: Update for demangling changes.
Diffstat (limited to 'gdb/d-lang.c')
-rw-r--r-- | gdb/d-lang.c | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 87d82da..e98138f 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -23,8 +23,8 @@ #include "varobj.h" #include "d-lang.h" #include "c-lang.h" -#include "parser-defs.h" -#include "gdb_obstack.h" +#include "demangle.h" +#include "cp-support.h" /* The name of the symbol to use to get the name of the main subprogram. */ static const char D_MAIN[] = "D main"; @@ -52,37 +52,7 @@ d_main_name (void) char * d_demangle (const char *symbol, int options) { - struct obstack tempbuf; - char *result; - - if ((symbol == NULL) || (*symbol == '\0')) - return NULL; - else if (strcmp (symbol, "_Dmain") == 0) - return xstrdup ("D main"); - - obstack_init (&tempbuf); - - if (strncmp (symbol, "_D", 2) == 0) - symbol += 2; - else - { - obstack_free (&tempbuf, NULL); - return NULL; - } - - if (d_parse_symbol (&tempbuf, symbol) != NULL) - { - obstack_grow_str0 (&tempbuf, ""); - result = xstrdup (obstack_finish (&tempbuf)); - obstack_free (&tempbuf, NULL); - } - else - { - obstack_free (&tempbuf, NULL); - return NULL; - } - - return result; + return gdb_demangle (symbol, options | DMGL_DLANG); } /* Table mapping opcodes into strings for printing operators |