mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-14 19:38:01 +08:00
Add --demangle and --no-demangle options:
* gprof.h (demangle): Declare. * gprof.c (demangle): New global variable. (OPTION_DEMANGLE, OPTION_NO_DEMANGLE): Define. (long_options): Add "demangle" and "no-demangle". (usage): Mention --demangle and --no-demangle. (main): Handle OPTION_DEMANGLE and OPTION_NO_DEMANGLE. * utils.c (print_name_only): Only demangle symbol name if demangle is true. * gprof.texi (Output Options): Document new options.
This commit is contained in:
@ -1,3 +1,16 @@
|
|||||||
|
Tue Mar 24 19:00:11 1998 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
Add --demangle and --no-demangle options:
|
||||||
|
* gprof.h (demangle): Declare.
|
||||||
|
* gprof.c (demangle): New global variable.
|
||||||
|
(OPTION_DEMANGLE, OPTION_NO_DEMANGLE): Define.
|
||||||
|
(long_options): Add "demangle" and "no-demangle".
|
||||||
|
(usage): Mention --demangle and --no-demangle.
|
||||||
|
(main): Handle OPTION_DEMANGLE and OPTION_NO_DEMANGLE.
|
||||||
|
* utils.c (print_name_only): Only demangle symbol name if demangle
|
||||||
|
is true.
|
||||||
|
* gprof.texi (Output Options): Document new options.
|
||||||
|
|
||||||
Fri Mar 20 19:21:56 1998 Ian Lance Taylor <ian@cygnus.com>
|
Fri Mar 20 19:21:56 1998 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
* Makefile.in: Rebuild with automake 1.2e.
|
* Makefile.in: Rebuild with automake 1.2e.
|
||||||
|
@ -42,6 +42,7 @@ int debug_level = 0;
|
|||||||
int output_style = 0;
|
int output_style = 0;
|
||||||
int output_width = 80;
|
int output_width = 80;
|
||||||
bool bsd_style_output = FALSE;
|
bool bsd_style_output = FALSE;
|
||||||
|
bool demangle = TRUE;
|
||||||
bool discard_underscores = TRUE;
|
bool discard_underscores = TRUE;
|
||||||
bool ignore_direct_calls = FALSE;
|
bool ignore_direct_calls = FALSE;
|
||||||
bool ignore_static_funcs = FALSE;
|
bool ignore_static_funcs = FALSE;
|
||||||
@ -73,6 +74,12 @@ static char *default_excluded_list[] =
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Codes used for the long options with no short synonyms. 150 isn't
|
||||||
|
special; it's just an arbitrary non-ASCII char value. */
|
||||||
|
|
||||||
|
#define OPTION_DEMANGLE (150)
|
||||||
|
#define OPTION_NO_DEMANGLE (OPTION_DEMANGLE + 1)
|
||||||
|
|
||||||
static struct option long_options[] =
|
static struct option long_options[] =
|
||||||
{
|
{
|
||||||
{"line", no_argument, 0, 'l'},
|
{"line", no_argument, 0, 'l'},
|
||||||
@ -97,6 +104,8 @@ static struct option long_options[] =
|
|||||||
/* various options to affect output: */
|
/* various options to affect output: */
|
||||||
|
|
||||||
{"all-lines", no_argument, 0, 'x'},
|
{"all-lines", no_argument, 0, 'x'},
|
||||||
|
{"demangle", no_argument, 0, OPTION_DEMANGLE},
|
||||||
|
{"no-demangle", no_argument, 0, OPTION_NO_DEMANGLE},
|
||||||
{"directory-path", required_argument, 0, 'I'},
|
{"directory-path", required_argument, 0, 'I'},
|
||||||
{"display-unused-functions", no_argument, 0, 'z'},
|
{"display-unused-functions", no_argument, 0, 'z'},
|
||||||
{"min-count", required_argument, 0, 'm'},
|
{"min-count", required_argument, 0, 'm'},
|
||||||
@ -144,6 +153,7 @@ Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\
|
|||||||
[--no-static] [--print-path] [--separate-files]\n\
|
[--no-static] [--print-path] [--separate-files]\n\
|
||||||
[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n\
|
[--static-call-graph] [--sum] [--table-length=len] [--traditional]\n\
|
||||||
[--version] [--width=n] [--ignore-non-functions]\n\
|
[--version] [--width=n] [--ignore-non-functions]\n\
|
||||||
|
[--demangle] [--no-demangle]\n\
|
||||||
[image-file] [profile-file...]\n",
|
[image-file] [profile-file...]\n",
|
||||||
whoami);
|
whoami);
|
||||||
if (status == 0)
|
if (status == 0)
|
||||||
@ -404,6 +414,12 @@ This program is free software. This program has absolutely no warranty.\n");
|
|||||||
}
|
}
|
||||||
user_specified |= STYLE_ANNOTATED_SOURCE;
|
user_specified |= STYLE_ANNOTATED_SOURCE;
|
||||||
break;
|
break;
|
||||||
|
case OPTION_DEMANGLE:
|
||||||
|
demangle = TRUE;
|
||||||
|
break;
|
||||||
|
case OPTION_NO_DEMANGLE:
|
||||||
|
demangle = FALSE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage (stderr, 1);
|
usage (stderr, 1);
|
||||||
}
|
}
|
||||||
|
@ -112,6 +112,7 @@ extern int debug_level; /* debug level */
|
|||||||
extern int output_style;
|
extern int output_style;
|
||||||
extern int output_width; /* controls column width in index */
|
extern int output_width; /* controls column width in index */
|
||||||
extern bool bsd_style_output; /* as opposed to FSF style output */
|
extern bool bsd_style_output; /* as opposed to FSF style output */
|
||||||
|
extern bool demangle; /* demangle symbol names? */
|
||||||
extern bool discard_underscores; /* discard leading underscores? */
|
extern bool discard_underscores; /* discard leading underscores? */
|
||||||
extern bool ignore_direct_calls; /* don't count direct calls */
|
extern bool ignore_direct_calls; /* don't count direct calls */
|
||||||
extern bool ignore_static_funcs; /* suppress static functions */
|
extern bool ignore_static_funcs; /* suppress static functions */
|
||||||
|
@ -477,6 +477,12 @@ are annotated. If this option is specified, every line in
|
|||||||
a basic-block is annotated by repeating the annotation for the
|
a basic-block is annotated by repeating the annotation for the
|
||||||
first line. This behavior is similar to @code{tcov}'s @samp{-a}.
|
first line. This behavior is similar to @code{tcov}'s @samp{-a}.
|
||||||
|
|
||||||
|
@item --demangle
|
||||||
|
@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.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Analysis Options,Miscellaneous Options,Output Options,Invoking
|
@node Analysis Options,Miscellaneous Options,Output Options,Invoking
|
||||||
|
@ -42,12 +42,15 @@ DEFUN (print_name_only, (self), Sym * self)
|
|||||||
{
|
{
|
||||||
name++;
|
name++;
|
||||||
}
|
}
|
||||||
|
if (demangle)
|
||||||
|
{
|
||||||
demangled = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
|
demangled = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
|
||||||
if (demangled)
|
if (demangled)
|
||||||
{
|
{
|
||||||
name = demangled;
|
name = demangled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
printf ("%s", name);
|
printf ("%s", name);
|
||||||
size = strlen (name);
|
size = strlen (name);
|
||||||
if (line_granularity && self->file)
|
if (line_granularity && self->file)
|
||||||
|
Reference in New Issue
Block a user