X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gprof%2Fgprof.c;h=aca143c8b865eec973e2927a7a392274e040304a;hb=45d42143d489a6b7ee78fd118b573906c43ecb0b;hp=dbb8cca20ffd1a7ca0a0693b71eee5e50744ae81;hpb=2ef8a0a8c2d6b1c34557b0f96e2c81b32f5d1a25;p=deliverable%2Fbinutils-gdb.git diff --git a/gprof/gprof.c b/gprof/gprof.c index dbb8cca20f..aca143c8b8 100644 --- a/gprof/gprof.c +++ b/gprof/gprof.c @@ -29,6 +29,7 @@ #include "libiberty.h" #include "gprof.h" +#include "bfdver.h" #include "search_list.h" #include "source.h" #include "symtab.h" @@ -59,7 +60,6 @@ int output_style = 0; int output_width = 80; bfd_boolean bsd_style_output = FALSE; bfd_boolean demangle = TRUE; -bfd_boolean discard_underscores = TRUE; bfd_boolean ignore_direct_calls = FALSE; bfd_boolean ignore_static_funcs = FALSE; bfd_boolean ignore_zeros = TRUE; @@ -77,8 +77,6 @@ char copyright[] = static char *gmon_name = GMONNAME; /* profile filename */ -bfd *abfd; - /* * Functions that get excluded by default: */ @@ -169,10 +167,10 @@ Usage: %s [-[abcDhilLsTvwxyz]] [-[ACeEfFJnNOpPqQZ][name]] [-I dirs]\n\ [--no-static] [--print-path] [--separate-files]\n\ [--static-call-graph] [--sum] [--table-length=len] [--traditional]\n\ [--version] [--width=n] [--ignore-non-functions]\n\ - [--demangle[=STYLE]] [--no-demangle]\n\ + [--demangle[=STYLE]] [--no-demangle] [@FILE]\n\ [image-file] [profile-file...]\n"), whoami); - if (status == 0) + if (REPORT_BUGS_TO[0] && status == 0) fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); done (status); } @@ -191,14 +189,18 @@ main (int argc, char **argv) #if defined (HAVE_SETLOCALE) setlocale (LC_CTYPE, ""); #endif +#ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); +#endif whoami = argv[0]; xmalloc_set_program_name (whoami); + expandargv (&argc, &argv); + while ((ch = getopt_long (argc, argv, - "aA::bBcCd::De:E:f:F:hiI:J::k:lLm:n::N::O:p::P::q::Q::st:Tvw:xyzZ::", + "aA::bBcC::d::De:E:f:F:hiI:J::k:lLm:n:N:O:p::P::q::Q::rR:st:Tvw:xyzZ::", long_options, 0)) != EOF) { @@ -409,7 +411,7 @@ main (int argc, char **argv) break; case 'v': /* This output is intended to follow the GNU standards document. */ - printf (_("GNU gprof %s\n"), VERSION); + printf (_("GNU gprof %s\n"), BFD_VERSION_STRING); printf (_("Based on BSD gprof, copyright 1983 Regents of the University of California.\n")); printf (_("\ This program is free software. This program has absolutely no warranty.\n")); @@ -543,7 +545,12 @@ This program is free software. This program has absolutely no warranty.\n")); if (output_style == 0) { if (gmon_input & (INPUT_HISTOGRAM | INPUT_CALL_GRAPH)) - output_style = STYLE_FLAT_PROFILE | STYLE_CALL_GRAPH; + { + if (gmon_input & INPUT_HISTOGRAM) + output_style |= STYLE_FLAT_PROFILE; + if (gmon_input & INPUT_CALL_GRAPH) + output_style |= STYLE_CALL_GRAPH; + } else output_style = STYLE_EXEC_COUNTS;