X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gprof%2Futils.c;h=4fc2db6038e94c91965a0120c37dbd5190503489;hb=8493b6651af3d2130d5f5f050905cd3d6e8a9c27;hp=0f54a61fd11b5cba906c1626344c29d7ae0c49a0;hpb=5ec4a8f31301e303c88a997205069237b9bbe29e;p=deliverable%2Fbinutils-gdb.git diff --git a/gprof/utils.c b/gprof/utils.c index 0f54a61fd1..4fc2db6038 100644 --- a/gprof/utils.c +++ b/gprof/utils.c @@ -26,21 +26,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#include "demangle.h" #include "gprof.h" +#include "demangle.h" #include "search_list.h" #include "source.h" #include "symtab.h" #include "cg_arcs.h" #include "utils.h" +#include "corefile.h" /* * Print name of symbol. Return number of characters printed. */ int -print_name_only (self) - Sym *self; +print_name_only (Sym *self) { const char *name = self->name; const char *filename; @@ -50,24 +50,15 @@ print_name_only (self) if (name) { - if (!bsd_style_output) + if (!bsd_style_output && demangle) { - if (name[0] == '_' && name[1] && discard_underscores) - { - name++; - } - if (demangle) - { - demangled = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS); - if (demangled) - { - name = demangled; - } - } + demangled = bfd_demangle (core_bfd, name, DMGL_ANSI | DMGL_PARAMS); + if (demangled) + name = demangled; } printf ("%s", name); size = strlen (name); - if (line_granularity && self->file) + if ((line_granularity || inline_file_names) && self->file) { filename = self->file->name; if (!print_path) @@ -82,8 +73,15 @@ print_name_only (self) filename = self->file->name; } } - sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num, - (unsigned long) self->addr); + if (line_granularity) + { + sprintf (buf, " (%s:%d @ %lx)", filename, self->line_num, + (unsigned long) self->addr); + } + else + { + sprintf (buf, " (%s:%d)", filename, self->line_num); + } printf ("%s", buf); size += strlen (buf); } @@ -99,8 +97,7 @@ print_name_only (self) void -print_name (self) - Sym *self; +print_name (Sym *self) { print_name_only (self);