diff options
author | DJ Delorie <dj@redhat.com> | 2002-02-05 17:53:17 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2002-02-05 17:53:17 +0000 |
commit | 44354ae183cc7d12c559514506b506cbed4d9d31 (patch) | |
tree | ae8d93fa48a6dac1465bf0669f95870b03451fd7 /libiberty | |
parent | c17aa31873e864b932e2f2d562b19d94029352a1 (diff) | |
download | gdb-44354ae183cc7d12c559514506b506cbed4d9d31.zip gdb-44354ae183cc7d12c559514506b506cbed4d9d31.tar.gz gdb-44354ae183cc7d12c559514506b506cbed4d9d31.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 9 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 23 | ||||
-rw-r--r-- | libiberty/cplus-dem.c | 11 |
3 files changed, 18 insertions, 25 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index a263823..08cf00d 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,12 @@ +2002-02-05 Jason Merrill <jason@redhat.com> + + * cplus-dem.c (flags): Add DMGL_VERBOSE + (cplus_demangle_v3_p): Remove. + (demangle_it): Add DMGL_TYPES to passed flags. + * cp-demangle.c (cplus_demangle_v3_all): Remove. + (cplus_demangle_v3_type): Remove. + (cplus_demangle_v3): Add options parm. + 2002-02-02 H.J. Lu (hjl@gnu.org) * cp-demangle.c (cp_demangle_type): Do not protect with diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 26e2010..136dc72 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -940,8 +940,6 @@ static status_t cp_demangle PARAMS ((const char *, dyn_string_t, int)); static status_t cp_demangle_type PARAMS ((const char*, dyn_string_t)); -static char* cplus_demangle_v3_all - PARAMS ((const char*, int)); /* When passed to demangle_bare_function_type, indicates that the function's return type is not encoded before its parameter types. */ @@ -3687,26 +3685,13 @@ __cxa_demangle (mangled_name, output_buffer, length, status) If the demangling failes, returns NULL. */ char * -cplus_demangle_v3 (mangled) +cplus_demangle_v3 (mangled, options) const char* mangled; -{ - return cplus_demangle_v3_all (mangled, 0); -} - -char * -cplus_demangle_v3_type (mangled) - const char* mangled; -{ - return cplus_demangle_v3_all (mangled, 1); -} - -static char * -cplus_demangle_v3_all (mangled, type) - const char* mangled; - int type; + int options; { dyn_string_t demangled; status_t status; + int type = !!(options & DMGL_TYPES); if (mangled[0] == '_' && mangled[1] == 'Z') /* It is not a type. */ @@ -3718,6 +3703,8 @@ cplus_demangle_v3_all (mangled, type) return NULL; } + flag_verbose = !!(options & DMGL_VERBOSE); + /* Create a dyn_string to hold the demangled name. */ demangled = dyn_string_new (0); /* Attempt the demangling. */ diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index b66d26d..4e60b2c 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -478,9 +478,6 @@ do_hpacc_template_literal PARAMS ((struct work_stuff *, const char **, string *) static int snarf_numeric_literal PARAMS ((const char **, string *)); -static char* (*cplus_demangle_v3_p) PARAMS ((const char* mangled)) - = cplus_demangle_v3; - /* There is a TYPE_QUAL value for each type qualifier. They can be combined by bitwise-or to form the complete set of qualifiers for a type. */ @@ -914,7 +911,7 @@ cplus_demangle (mangled, options) /* The V3 ABI demangling is implemented elsewhere. */ if (GNU_V3_DEMANGLING || AUTO_DEMANGLING) { - ret = cplus_demangle_v3_p (mangled); + ret = cplus_demangle_v3 (mangled, work->options); if (ret || GNU_V3_DEMANGLING) return ret; } @@ -4877,7 +4874,7 @@ string_append_template_idx (s, idx) static const char *program_name; static const char *program_version = VERSION; -static int flags = DMGL_PARAMS | DMGL_ANSI; +static int flags = DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE; static void demangle_it PARAMS ((char *)); static void usage PARAMS ((FILE *, int)) ATTRIBUTE_NORETURN; @@ -4890,7 +4887,8 @@ demangle_it (mangled_name) { char *result; - result = cplus_demangle (mangled_name, flags); + /* For command line args, also try to demangle type encodings. */ + result = cplus_demangle (mangled_name, flags | DMGL_TYPES); if (result == NULL) { printf ("%s\n", mangled_name); @@ -5089,7 +5087,6 @@ main (argc, argv) if (optind < argc) { - cplus_demangle_v3_p = cplus_demangle_v3_type; for ( ; optind < argc; optind++) { demangle_it (argv[optind]); |