This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch] gprof: accept nested subprograms


Hi,

nested subprograms are considered as not interesting and do not appear in results. I think this is quiet annoying.
This patch fixes the issue.


Tristan.

gprof/Changelog:
2007-07-04  Tristan Gingold  <gingold@adacore.com>

* corefile.c (core_sym_class): Do not discard nested subprograms.

*** gprof/corefile.c    19 Apr 2007 10:46:56 -0000      1.27
--- gprof/corefile.c    4 Jul 2007 14:39:25 -0000
*************** core_sym_class (asymbol *sym)
*** 365,372 ****

    for (name = sym->name; *name; ++name)
      {
!       if (*name == '.' || *name == '$')
        return 0;
      }

    /* On systems where the C compiler adds an underscore to all
--- 365,380 ----

for (name = sym->name; *name; ++name)
{
! if (*name == '$')
return 0;
+ /* Do not discard nested subprograms (those which finishes with .NNN,
+ where N are digits. */
+ if (*name == '.')
+ {
+ for (name++; *name; name++)
+ if (*name < '0' || *name > '9')
+ return 0;
+ }
}


/* On systems where the C compiler adds an underscore to all


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]