Initial python support.
[deliverable/binutils-gdb.git] / gprof / corefile.c
index a078d61c8933fb5c59b3d71b989aed1ed5119939..243a600f7e2ed6fa9cb79d7cea985fd5a4f227a4 100644 (file)
@@ -1,13 +1,13 @@
 /* corefile.c
 
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
    Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 \f
-#include "libiberty.h"
 #include "gprof.h"
+#include "libiberty.h"
 #include "search_list.h"
 #include "source.h"
 #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
@@ -419,7 +427,8 @@ get_src_info (bfd_vma addr, const char **filename, const char **name, int *line_
   else
     {
       DBG (AOUTDEBUG, printf ("[get_src_info] no info for 0x%lx (%s:%d,%s)\n",
-                             (long) addr, fname ? fname : "<unknown>", l,
+                             (unsigned long) addr,
+                             fname ? fname : "<unknown>", l,
                              func_name ? func_name : "<unknown>"));
       return FALSE;
     }
This page took 0.023188 seconds and 4 git commands to generate.