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-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.
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 \
../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 \
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 \
../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 \
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,
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,
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;
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 */
#include "symtab.h"
#include "cg_arcs.h"
#include "sym_ids.h"
+#include "corefile.h"
static struct sym_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;
}
#include "symtab.h"
#include "cg_arcs.h"
#include "utils.h"
+#include "corefile.h"
/*
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);