diff options
author | Fred Fish <fnf@specifix.com> | 1992-05-05 18:16:23 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-05-05 18:16:23 +0000 |
commit | 8f793aa54168462d7525a44e83e6a56c7f362a5e (patch) | |
tree | 1aa179a28019c4b45822843a45e55ddb7c41768c /gdb/valprint.c | |
parent | 939a34334201ecba8870c2f29982f8d47b716d65 (diff) | |
download | gdb-8f793aa54168462d7525a44e83e6a56c7f362a5e.zip gdb-8f793aa54168462d7525a44e83e6a56c7f362a5e.tar.gz gdb-8f793aa54168462d7525a44e83e6a56c7f362a5e.tar.bz2 |
* Makefile.in (DEMANGLER): Define and default to cplus-dem.
Allows selection of C++ demangler to be a configuration option
until multiple demanglers are supported.
* demangle.h: New include file for extended demangler support.
* breakpoint.c, gdbtypes.c, printcmd.c, stack.c, symtab.c,
utils.c, valprint.c: Include "demangle.h" and change all calls
to cplus_demangle() or fputs_demangled() to use individual
demangling options.
* valprint.c (type_print_1): Change options to cplus_demangle
to print demangled function args. Still broken, but now less so.
* cplus-dem.c: Include demangle.h, reorganize and update some
comments to reflect reality.
* cplus-dem.c (cplus_demangle, cplus_mangle_opname): Change
second arg from fixed integer to bit based multiple options.
* cplus-dem.c (optable): Reformat and replace ansi members with
bit based options.
* cplus-dem.c (do_type): Fix bug with parsing missing return type.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index 1675eb1..6492f1d 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -27,6 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "target.h" #include "obstack.h" #include "language.h" +#include "demangle.h" #include <errno.h> @@ -1032,7 +1033,8 @@ val_print (type, valaddr, address, stream, format, deref_ref, recurse, pretty) if ((msymbol != NULL) && (vt_address == msymbol -> address)) { fputs_filtered (" <", stream); - fputs_demangled (msymbol -> name, stream, 1); + fputs_demangled (msymbol -> name, stream, + DMGL_ANSI | DMGL_PARAMS); fputs_filtered (">", stream); } if (vtblprint) @@ -1363,8 +1365,12 @@ type_print_1 (type, varstring, stream, show, level) || code == TYPE_CODE_REF))) fprintf_filtered (stream, " "); type_print_varspec_prefix (type, stream, show, 0); - fputs_demangled (varstring, stream, -1); /* Print demangled name - without arguments */ + /* FIXME: Previously this printed demangled names without function args, + which is a lose since you can't distinguish between overloaded function + names (try "info func" for example). This change is still not optimal, + since you now get a superflous pair of parens for functions, but at + least you can distinguish them. */ + fputs_demangled (varstring, stream, DMGL_PARAMS); type_print_varspec_suffix (type, stream, show, 0); } @@ -1378,8 +1384,8 @@ type_print_method_args (args, prefix, varstring, staticp, stream) { int i; - fputs_demangled (prefix, stream, 1); - fputs_demangled (varstring, stream, 1); + fputs_demangled (prefix, stream, DMGL_ANSI | DMGL_PARAMS); + fputs_demangled (varstring, stream, DMGL_ANSI | DMGL_PARAMS); fputs_filtered (" (", stream); if (args && args[!staticp] && args[!staticp]->code != TYPE_CODE_VOID) { @@ -1790,7 +1796,9 @@ type_print_base (type, stream, show, level) { /* Build something we can demangle. */ char *mangled_name = gdb_mangle_name (type, i, j); - char *demangled_name = cplus_demangle (mangled_name, 1); + char *demangled_name = + cplus_demangle (mangled_name, + DMGL_ANSI | DMGL_PARAMS); if (demangled_name == 0) fprintf_filtered (stream, "<badly mangled name %s>", mangled_name); |