+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.
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'},
{
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);
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;
@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 ]
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.
@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 ]
@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
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
@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 ]
@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}
@item -s
@itemx --basenames
Display only the base of each file name.
-@end table
@node nlmconv
@chapter nlmconv
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'},
-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\
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)
{
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;
-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\
{"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'},
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;
+2000-07-05 Kenneth Block <krblock@computer.org>
+
+ * gprof/gprof.c: Add optional style to demangle switch
+ * gprof/gprof.texi: Document optional style to demangle switch.
+
2000-06-05 DJ Delorie <dj@redhat.com>
* MAINTAINERS: new
#include "hist.h"
#include "source.h"
#include "sym_ids.h"
+#include "demangle.h"
const char *whoami;
const char *function_mapping_file;
/* various options to affect output: */
{"all-lines", no_argument, 0, 'x'},
- {"demangle", no_argument, 0, OPTION_DEMANGLE},
+ {"demangle", optional_argument, 0, OPTION_DEMANGLE},
{"no-demangle", no_argument, 0, OPTION_NO_DEMANGLE},
{"directory-path", required_argument, 0, 'I'},
{"display-unused-functions", no_argument, 0, 'z'},
[--no-static] [--print-path] [--separate-files]\n\
[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n\
[--version] [--width=n] [--ignore-non-functions]\n\
- [--demangle] [--no-demangle]\n\
+ [--demangle[=STYLE]] [--no-demangle]\n\
[image-file] [profile-file...]\n"),
whoami);
if (status == 0)
break;
case OPTION_DEMANGLE:
demangle = TRUE;
+ if (optarg != NULL)
+ {
+ enum demangling_styles style;
+
+ style = cplus_demangle_name_to_style (optarg);
+ if (style == unknown_demangling)
+ {
+ fprintf (stderr,
+ _("%s: unknown demangling style `%s'\n"),
+ whoami, optarg);
+ xexit (1);
+ }
+
+ cplus_demangle_set_style (style);
+ }
break;
case OPTION_NO_DEMANGLE:
demangle = FALSE;
a basic-block is annotated by repeating the annotation for the
first line. This behavior is similar to @code{tcov}'s @samp{-a}.
-@item --demangle
+@item --demangle[=@var{style}]
@itemx --no-demangle
These options control whether C++ symbol names should be demangled when
printing output. The default is to demangle symbols. The
-@code{--no-demangle} option may be used to turn off demangling.
-
+@code{--no-demangle} option may be used to turn off demangling. Different
+compilers have different mangling styles. The optional demangling style
+argument can be used to choose an appropriate demangling style for your
+compiler.
@end table
@node Analysis Options,Miscellaneous Options,Output Options,Invoking
+2000-07-05 Kenneth Block <krblock@computer.org>
+
+ * ld/lexsup.c: Add optional style to demangle switch
+ * ld/ld.texinfo: Document optional style to demangle switch.
+
2000-07-20 Hans-Peter Nilsson <hp@axis.com>
* Makefile.am (ALL_EMULATIONS): Add ecrisaout.o, ecriself.o,
@var{expression}.
@cindex demangling, from command line
-@kindex --demangle
+@kindex --demangle[=@var{style}]
@kindex --no-demangle
-@item --demangle
+@item --demangle[=@var{style}]
@itemx --no-demangle
These options control whether to demangle symbol names in error messages
and other output. When the linker is told to demangle, it tries to
present symbol names in a readable fashion: it strips leading
underscores if they are used by the object file format, and converts C++
-mangled symbol names into user readable names. The linker will demangle
-by default unless the environment variable @samp{COLLECT_NO_DEMANGLE} is
-set. These options may be used to override the default.
+mangled symbol names into user readable names. Different compilers have
+different mangling styles. The optional demangling style argument can be used
+to choose an appropriate demangling style for your compiler. The linker will
+demangle by default unless the environment variable @samp{COLLECT_NO_DEMANGLE}
+is set. These options may be used to override the default.
@cindex dynamic linker, from command line
@kindex --dynamic-linker @var{file}
either by specifying a list of names separated by colons, or by
appearing multiple times.
+This option should be used with caution as it overrides the search path
+that may have been hard compiled into a shared library. In such a case it
+is possible to use unintentionally a different search path than the
+runtime linker would do.
+
The linker uses the following search paths to locate required shared
libraries.
@enumerate
#include "ldfile.h"
#include "ldver.h"
#include "ldemul.h"
+#include "demangle.h"
#ifndef PATH_SEPARATOR
#if defined (__MSDOS__) || (defined (_WIN32) && ! defined (__CYGWIN32__))
'\0', NULL, N_("Output cross reference table"), TWO_DASHES },
{ {"defsym", required_argument, NULL, OPTION_DEFSYM},
'\0', N_("SYMBOL=EXPRESSION"), N_("Define a symbol"), TWO_DASHES },
- { {"demangle", no_argument, NULL, OPTION_DEMANGLE},
- '\0', NULL, N_("Demangle symbol names"), TWO_DASHES },
+ { {"demangle", optional_argument, NULL, OPTION_DEMANGLE},
+ '\0', N_("[=STYLE]"), N_("Demangle symbol names [using STYLE]"), TWO_DASHES },
{ {"dynamic-linker", required_argument, NULL, OPTION_DYNAMIC_LINKER},
'\0', N_("PROGRAM"), N_("Set the dynamic linker to use"), TWO_DASHES },
{ {"embedded-relocs", no_argument, NULL, OPTION_EMBEDDED_RELOCS},
break;
case OPTION_DEMANGLE:
demangling = true;
+ if (optarg != NULL)
+ {
+ enum demangling_styles style;
+
+ style = cplus_demangle_name_to_style (optarg);
+ if (style == unknown_demangling)
+ einfo (_("%F%P: unknown demangling style `%s'"),
+ optarg);
+
+ cplus_demangle_set_style (style);
+ }
break;
case OPTION_DYNAMIC_LINKER:
command_line.interpreter = optarg;