aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2007-07-05 09:07:30 +0000
committerNick Clifton <nickc@redhat.com>2007-07-05 09:07:30 +0000
commit3289fe0ce07986d2d93e5ac8461e7fc1d43d8012 (patch)
treedb86c16edf7667abba8cb9f4c7b4374ef97e5810
parent29422971f1854e0b2fef00243c2924ae9f3bdecc (diff)
downloadgdb-3289fe0ce07986d2d93e5ac8461e7fc1d43d8012.zip
gdb-3289fe0ce07986d2d93e5ac8461e7fc1d43d8012.tar.gz
gdb-3289fe0ce07986d2d93e5ac8461e7fc1d43d8012.tar.bz2
* corefile.c (core_sym_class): Do not discard nested subprograms.
-rw-r--r--gprof/ChangeLog4
-rw-r--r--gprof/Makefile.am2
-rw-r--r--gprof/Makefile.in10
-rw-r--r--gprof/corefile.c14
4 files changed, 21 insertions, 9 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index a44279d..82f8015 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,7 @@
+2007-07-05 Tristan Gingold <gingold@adacore.com>
+
+ * corefile.c (core_sym_class): Do not discard nested subprograms.
+
2007-07-02 Alan Modra <amodra@bigpond.net.au>
* Makefile.am: Run "make dep-am".
diff --git a/gprof/Makefile.am b/gprof/Makefile.am
index 7403937..edf4a8e 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 ../bfd/config.h $(INCDIR)/ansidecl.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 hist.h corefile.h
+ source.h symtab.h hist.h corefile.h $(INCDIR)/safe-ctype.h
gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
$(INCDIR)/ansidecl.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 d609fe3..d5c6925 100644
--- a/gprof/Makefile.in
+++ b/gprof/Makefile.in
@@ -293,15 +293,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --cygnus '; \
- cd $(srcdir) && $(AUTOMAKE) --cygnus \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --cygnus Makefile
+ $(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -971,7 +971,7 @@ corefile.o: corefile.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h $(INCDIR)/ansidecl.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 hist.h corefile.h
+ source.h symtab.h hist.h corefile.h $(INCDIR)/safe-ctype.h
gmon_io.o: gmon_io.c gprof.h $(BFDDIR)/sysdep.h ../bfd/config.h \
$(INCDIR)/ansidecl.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 a078d61..a9f1f6c 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -1,6 +1,6 @@
/* corefile.c
- Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -27,6 +27,7 @@
#include "symtab.h"
#include "hist.h"
#include "corefile.h"
+#include "safe-ctype.h"
bfd *core_bfd;
static int core_num_syms;
@@ -365,8 +366,15 @@ core_sym_class (asymbol *sym)
for (name = sym->name; *name; ++name)
{
- if (*name == '.' || *name == '$')
- return 0;
+ if (*name == '$')
+ return 0;
+
+ /* Do not discard nested subprograms (those
+ which end with .NNN, where N are digits). */
+ if (*name == '.')
+ for (name++; *name; name++)
+ if (! ISDIGIT (*name))
+ return 0;
}
/* On systems where the C compiler adds an underscore to all