diff options
author | Nick Clifton <nickc@redhat.com> | 2000-07-20 18:02:56 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-07-20 18:02:56 +0000 |
commit | 28c309a2879d8f66e75cd84b049ff49d508a36c6 (patch) | |
tree | f301b3cf30e87822c6fe0b712ea2b7aa51310903 /binutils | |
parent | 483f05e373e2ec8f9ff6a37f5c8d8deca3138ea3 (diff) | |
download | gdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.zip gdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.tar.gz gdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.tar.bz2 |
Add optional style argument to --demangle switch.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 8 | ||||
-rw-r--r-- | binutils/addr2line.c | 15 | ||||
-rw-r--r-- | binutils/binutils.texi | 33 | ||||
-rw-r--r-- | binutils/nm.c | 20 | ||||
-rw-r--r-- | binutils/objdump.c | 17 |
5 files changed, 73 insertions, 20 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e24cabe..f4524c8 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,11 @@ +2000-07-05 Kenneth Block <krblock@computer.org> + + * binutils/nm.c: Add optional style to demangle switch. + * binutils/objdump.c: Add optional style to demangle switch. + * binutils/addr2line.c: Add optional style to demangle switch. + * binutils/binutils.texi: Document optional style to demangle + switch. + 2000-07-20 Hans-Peter Nilsson <hp@axis.com> * MAINTAINERS: Add self as CRIS port maintainer. diff --git a/binutils/addr2line.c b/binutils/addr2line.c index 20c7eef..9232a9e 100644 --- a/binutils/addr2line.c +++ b/binutils/addr2line.c @@ -51,7 +51,7 @@ static asymbol **syms; /* Symbol table. */ static struct option long_options[] = { {"basenames", no_argument, NULL, 's'}, - {"demangle", no_argument, NULL, 'C'}, + {"demangle", optional_argument, NULL, 'C'}, {"exe", required_argument, NULL, 'e'}, {"functions", no_argument, NULL, 'f'}, {"target", required_argument, NULL, 'b'}, @@ -75,7 +75,7 @@ usage (stream, status) { fprintf (stream, _("\ Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n\ - [-e executable] [--exe=executable] [--demangle]\n\ + [-e executable] [--exe=executable] [--demangle[=style]]\n\ [--basenames] [--functions] [addr addr ...]\n"), program_name); list_supported_targets (program_name, stream); @@ -301,6 +301,17 @@ main (argc, argv) break; case 'C': do_demangle = true; + if (optarg != NULL) + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + fatal (_("unknown demangling style `%s'"), + optarg); + + cplus_demangle_set_style (style); + } break; case 'e': filename = optarg; diff --git a/binutils/binutils.texi b/binutils/binutils.texi index 437c843..6c2cfc8 100644 --- a/binutils/binutils.texi +++ b/binutils/binutils.texi @@ -630,7 +630,7 @@ The @sc{gnu} linker @code{ld} is now described in a separate manual. @smallexample nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle ] [ -D | --dynamic ] + [ -B ] [ -C | --demangle[=@var{style}] ] [ -D | --dynamic ] [ -s | --print-armap ] [ -A | -o | --print-file-name ] [ -n | -v | --numeric-sort ] [ -p | --no-sort ] [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] @@ -754,12 +754,14 @@ listed. The same as @samp{--format=bsd} (for compatibility with the MIPS @code{nm}). @item -C -@itemx --demangle +@itemx --demangle[=@var{style}] @cindex demangling in nm Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. @xref{c++filt}, for more information -on demangling. +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. @item --no-demangle Do not demangle low-level symbol names. This is the default. @@ -1173,7 +1175,7 @@ Show a summary of the options to @code{objcopy}. @smallexample objdump [ -a | --archive-headers ] [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle ] + [ -C | --demangle[=@var{style}] ] [ -d | --disassemble ] [ -D | --disassemble-all ] [ -z | --disassemble-zeroes ] @@ -1258,12 +1260,14 @@ formats available with the @samp{-i} option. @xref{Target Selection}, for more information. @item -C -@itemx --demangle +@itemx --demangle[=@var{style}] @cindex demangling in objdump Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. @xref{c++filt}, for more information -on demangling. +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. @item -G @item --debugging @@ -1859,6 +1863,8 @@ the one specified by the C++ Annotated Reference Manual the one used by the HP compiler @item edg the one used by the EDG compiler +@item gnu-new-abi +the one used by the @sc{gnu} compiler with the new ABI. @end table @item --help @@ -1894,7 +1900,7 @@ c++filt @var{option} @var{symbol} @smallexample addr2line [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle ] + [ -C | --demangle[=@var{style} ] [ -e @var{filename} | --exe=@var{filename} ] [ -f | --functions ] [ -s | --basename ] [ -H | --help ] [ -V | --version ] @@ -1941,12 +1947,14 @@ Specify that the object-code format for the object files is @var{bfdname}. @item -C -@itemx --demangle +@itemx --demangle[=@var{style}] @cindex demangling in objdump Decode (@dfn{demangle}) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this -makes C++ function names readable. @xref{c++filt}, for more information -on demangling. +makes C++ function names readable. Different compilers have different +mangling styles. The optional demangling style argument can be used to +choose an appropriate demangling style for your compiler. @xref{c++filt}, +for more information on demangling. @item -e @var{filename} @itemx --exe=@var{filename} @@ -1960,7 +1968,6 @@ Display function names as well as file and line number information. @item -s @itemx --basenames Display only the base of each file name. -@end table @node nlmconv @chapter nlmconv diff --git a/binutils/nm.c b/binutils/nm.c index ad5a00d..fca510c 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -260,7 +260,7 @@ static bfd *lineno_cache_rel_bfd; static struct option long_options[] = { {"debug-syms", no_argument, &print_debug_syms, 1}, - {"demangle", no_argument, &do_demangle, 1}, + {"demangle", optional_argument, 0, 'C'}, {"dynamic", no_argument, &dynamic, 1}, {"extern-only", no_argument, &external_only, 1}, {"format", required_argument, 0, 'f'}, @@ -297,7 +297,9 @@ usage (stream, status) -a, --debug-syms Display debugger-only symbols\n\ -A, --print-file-name Print name of the input file before every symbol\n\ -B Same as --format=bsd\n\ - -C, --demangle Decode low-level symbol names into user-level names\n\ + -C, --demangle[=STYLE] Decode low-level symbol names into user-level names\n\ + The STYLE, if specified, can be `auto' (the default),\n\ + `gnu', 'lucid', 'arm', 'hp', 'edg' or 'gnu-new-abi'\n\ --no-demangle Do not demangle low-level symbol names\n\ -D, --dynamic Display dynamic symbols instead of normal symbols\n\ --defined-only Display only defined symbols\n\ @@ -407,7 +409,8 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvV", long_options, (int *) 0)) != EOF) + while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvV", + long_options, (int *) 0)) != EOF) { switch (c) { @@ -423,6 +426,17 @@ main (argc, argv) break; case 'C': do_demangle = 1; + if (optarg != NULL) + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + fatal (_("unknown demangling style `%s'"), + optarg); + + cplus_demangle_set_style (style); + } break; case 'D': dynamic = 1; diff --git a/binutils/objdump.c b/binutils/objdump.c index 0d4a2c9..d71888a 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -255,7 +255,9 @@ usage (stream, status) -EL --endian=little Assume little endian format when disassembling\n\ --file-start-context Include context from start of file (with -S)\n\ -l, --line-numbers Include line numbers and filenames in output\n\ - -C, --demangle Decode mangled/processed symbol names\n\ + -C, --demangle[=STYLE] Decode mangled/processed symbol names\n\ + The STYLE, if specified, can be `auto', 'gnu',\n\ + 'lucid', 'arm', 'hp', 'edg', or 'gnu-new-abi'\n\ -w, --wide Format output for more than 80 columns\n\ -z, --disassemble-zeroes Do not skip blocks of zeroes when disassembling\n\ --start-address=ADDR Only process data whoes address is >= ADDR\n\ @@ -288,7 +290,7 @@ static struct option long_options[]= {"architecture", required_argument, NULL, 'm'}, {"archive-headers", no_argument, NULL, 'a'}, {"debugging", no_argument, NULL, 'g'}, - {"demangle", no_argument, NULL, 'C'}, + {"demangle", optional_argument, NULL, 'C'}, {"disassemble", no_argument, NULL, 'd'}, {"disassemble-all", no_argument, NULL, 'D'}, {"disassembler-options", required_argument, NULL, 'M'}, @@ -2833,6 +2835,17 @@ main (argc, argv) break; case 'C': do_demangle = true; + if (optarg != NULL) + { + enum demangling_styles style; + + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + fatal (_("unknown demangling style `%s'"), + optarg); + + cplus_demangle_set_style (style); + } break; case 'w': wide_output = true; |