aboutsummaryrefslogtreecommitdiff
path: root/binutils/addr2line.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/addr2line.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/addr2line.c')
-rw-r--r--binutils/addr2line.c15
1 files changed, 13 insertions, 2 deletions
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;