aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2007-04-19 10:46:56 +0000
committerAlan Modra <amodra@gmail.com>2007-04-19 10:46:56 +0000
commit8db406db3cc6d3458f34df478aab371896401d5e (patch)
tree32222877bc8555bcec82b512d7ce2672b7795c05 /gprof
parent73705ac309d244b61d3b372d61e867c05d8ea2a8 (diff)
downloadgdb-8db406db3cc6d3458f34df478aab371896401d5e.zip
gdb-8db406db3cc6d3458f34df478aab371896401d5e.tar.gz
gdb-8db406db3cc6d3458f34df478aab371896401d5e.tar.bz2
* corefile.c (core_create_function_syms, core_create_line_syms): Don't
set discard_underscores. * gprof.c (discard_underscores): Delete. * gprof.h (discard_underscores): Delete. * sym_ids.c (match): Use bfd_get_symbol_leading_char to check for leading underscores. * utils.c (print_name_only): Call bfd_demangle rather than cplus_demangle. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog13
-rw-r--r--gprof/Makefile.am6
-rw-r--r--gprof/Makefile.in6
-rw-r--r--gprof/corefile.c12
-rw-r--r--gprof/gprof.c1
-rw-r--r--gprof/gprof.h1
-rw-r--r--gprof/sym_ids.c20
-rw-r--r--gprof/utils.c18
8 files changed, 38 insertions, 39 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index fb5fffc..bca9591 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,16 @@
+2007-04-19 Alan Modra <amodra@bigpond.net.au>
+
+ * corefile.c (core_create_function_syms, core_create_line_syms): Don't
+ set discard_underscores.
+ * gprof.c (discard_underscores): Delete.
+ * gprof.h (discard_underscores): Delete.
+ * sym_ids.c (match): Use bfd_get_symbol_leading_char to check for
+ leading underscores.
+ * utils.c (print_name_only): Call bfd_demangle rather than
+ cplus_demangle.
+ * Makefile.am: Run "make dep-am".
+ * Makefile.in: Regenerate.
+
2007-04-14 Steve Ellcey <sje@cup.hp.com>
* Makefile.am: Add ACLOCAL_AMFLAGS.
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 5ebdfe3..2a6a917 100644
--- a/gprof/Makefile.am
+++ b/gprof/Makefile.am
@@ -226,7 +226,7 @@ corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h ../bfd/config.h \
$(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h corefile.h
+ source.h symtab.h hist.h corefile.h
gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
@@ -270,13 +270,13 @@ sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- sym_ids.h
+ sym_ids.h corefile.h
utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- utils.h
+ utils.h corefile.h
i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
diff --git a/gprof/Makefile.in b/gprof/Makefile.in
index 0afe7c5..a73b356 100644
--- a/gprof/Makefile.in
+++ b/gprof/Makefile.in
@@ -958,7 +958,7 @@ corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h ../bfd/config.h \
$(INCDIR)/fopen-same.h $(INCDIR)/filenames.h ../bfd/bfd.h \
$(INCDIR)/ansidecl.h $(INCDIR)/symcat.h gconfig.h search_list.h \
- source.h symtab.h corefile.h
+ source.h symtab.h hist.h corefile.h
gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
@@ -1002,13 +1002,13 @@ sym_ids.o: sym_ids.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- sym_ids.h
+ sym_ids.h corefile.h
utils.o: utils.c $(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
$(INCDIR)/ansidecl.h gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
gconfig.h search_list.h source.h symtab.h cg_arcs.h \
- utils.h
+ utils.h corefile.h
i386.o: i386.c gprof.h $(BFDDIR)/sysdep.h $(INCDIR)/ansidecl.h \
../bfd/config.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h \
../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \
diff --git a/gprof/corefile.c b/gprof/corefile.c
index 7ad18f1..a078d61 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -581,12 +581,6 @@ core_create_function_syms ()
else
max_vma = MAX (symtab.limit->addr, max_vma);
- /* If we see "main" without an initial '_', we assume names
- are *not* prefixed by '_'. */
- if (symtab.limit->name[0] == 'm' && discard_underscores
- && strcmp (symtab.limit->name, "main") == 0)
- discard_underscores = 0;
-
DBG (AOUTDEBUG, printf ("[core_create_function_syms] %ld %s 0x%lx\n",
(long) (symtab.limit - symtab.base),
symtab.limit->name,
@@ -746,12 +740,6 @@ core_create_line_syms ()
prev = ltab.limit;
- /* If we see "main" without an initial '_', we assume names
- are *not* prefixed by '_'. */
- if (ltab.limit->name[0] == 'm' && discard_underscores
- && strcmp (ltab.limit->name, "main") == 0)
- discard_underscores = 0;
-
DBG (AOUTDEBUG, printf ("[core_create_line_syms] %lu %s 0x%lx\n",
(unsigned long) (ltab.limit - ltab.base),
ltab.limit->name,
diff --git a/gprof/gprof.c b/gprof/gprof.c
index 98406e6..aca143c 100644
--- a/gprof/gprof.c
+++ b/gprof/gprof.c
@@ -60,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;
diff --git a/gprof/gprof.h b/gprof/gprof.h
index aa873f3..4cb9e4a 100644
--- a/gprof/gprof.h
+++ b/gprof/gprof.h
@@ -119,7 +119,6 @@ extern int output_style;
extern int output_width; /* controls column width in index */
extern bfd_boolean bsd_style_output; /* as opposed to FSF style output */
extern bfd_boolean demangle; /* demangle symbol names? */
-extern bfd_boolean discard_underscores; /* discard leading underscores? */
extern bfd_boolean ignore_direct_calls; /* don't count direct calls */
extern bfd_boolean ignore_static_funcs; /* suppress static functions */
extern bfd_boolean ignore_zeros; /* ignore unused symbols/files */
diff --git a/gprof/sym_ids.c b/gprof/sym_ids.c
index d41a716..5b8f397 100644
--- a/gprof/sym_ids.c
+++ b/gprof/sym_ids.c
@@ -27,6 +27,7 @@
#include "symtab.h"
#include "cg_arcs.h"
#include "sym_ids.h"
+#include "corefile.h"
static struct sym_id
{
@@ -218,12 +219,19 @@ parse_id (struct sym_id *id)
static bfd_boolean
match (Sym *pattern, Sym *sym)
{
- return (pattern->file ? pattern->file == sym->file : TRUE)
- && (pattern->line_num ? pattern->line_num == sym->line_num : TRUE)
- && (pattern->name
- ? strcmp (pattern->name,
- sym->name+(discard_underscores && sym->name[0] == '_')) == 0
- : TRUE);
+ if (pattern->file && pattern->file != sym->file)
+ return FALSE;
+ if (pattern->line_num && pattern->line_num != sym->line_num)
+ return FALSE;
+ if (pattern->name)
+ {
+ const char *sym_name = sym->name;
+ if (*sym_name && bfd_get_symbol_leading_char (core_bfd) == *sym_name)
+ sym_name++;
+ if (strcmp (pattern->name, sym_name) != 0)
+ return FALSE;
+ }
+ return TRUE;
}
diff --git a/gprof/utils.c b/gprof/utils.c
index 146e1f3..cf79fd6 100644
--- a/gprof/utils.c
+++ b/gprof/utils.c
@@ -33,6 +33,7 @@
#include "symtab.h"
#include "cg_arcs.h"
#include "utils.h"
+#include "corefile.h"
/*
@@ -49,20 +50,11 @@ print_name_only (Sym *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);