aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-07-20 18:02:56 +0000
committerNick Clifton <nickc@redhat.com>2000-07-20 18:02:56 +0000
commit28c309a2879d8f66e75cd84b049ff49d508a36c6 (patch)
treef301b3cf30e87822c6fe0b712ea2b7aa51310903 /binutils/nm.c
parent483f05e373e2ec8f9ff6a37f5c8d8deca3138ea3 (diff)
downloadgdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.zip
gdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.tar.gz
gdb-28c309a2879d8f66e75cd84b049ff49d508a36c6.tar.bz2
Add optional style argument to --demangle switch.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c20
1 files changed, 17 insertions, 3 deletions
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;