aboutsummaryrefslogtreecommitdiff
path: root/gprof/sym_ids.c
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/sym_ids.c
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/sym_ids.c')
-rw-r--r--gprof/sym_ids.c20
1 files changed, 14 insertions, 6 deletions
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;
}