aboutsummaryrefslogtreecommitdiff
path: root/gprof
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-06-07 13:33:20 +0000
committerNick Clifton <nickc@redhat.com>2011-06-07 13:33:20 +0000
commitf36485f09d638d253ee09de07950dd7b85a2d99e (patch)
tree1819c401ed1037eca13729785d21c7c458f83cab /gprof
parent316a8b214511686e1eccdaca157cf7aecedd47dd (diff)
downloadbinutils-f36485f09d638d253ee09de07950dd7b85a2d99e.zip
binutils-f36485f09d638d253ee09de07950dd7b85a2d99e.tar.gz
binutils-f36485f09d638d253ee09de07950dd7b85a2d99e.tar.bz2
* corefile.c (core_sym_class): Allow for multiple iterations of
clone clones and subprograms.
Diffstat (limited to 'gprof')
-rw-r--r--gprof/ChangeLog5
-rw-r--r--gprof/corefile.c26
2 files changed, 22 insertions, 9 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 6b907ed..3e9a76e 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-07 David Warme <dwarme@groupw.com>
+
+ * corefile.c (core_sym_class): Allow for multiple iterations of
+ clone clones and subprograms.
+
2011-04-28 Jonathan Nieder <jrnieder@gmail.com>
* cg_print.c (print_header): Add no-c-format comment to prevent
diff --git a/gprof/corefile.c b/gprof/corefile.c
index 2d772f9..e25d19b 100644
--- a/gprof/corefile.c
+++ b/gprof/corefile.c
@@ -387,19 +387,27 @@ core_sym_class (asymbol *sym)
if (*name == '$')
return 0;
- if (*name == '.')
+ while (*name == '.')
{
- /* Allow GCC cloned functions. */
- if (strlen (name) > 7 && strncmp (name, ".clone.", 7) == 0)
- name += 6;
+ /* Allow both nested subprograms (which end with ".NNN", where N is
+ a digit) and GCC cloned functions (which contain ".clone").
+ Allow for multiple iterations of both - apparently GCC can clone
+ clones and subprograms. */
+ int digit_seen = 0;
+#define CLONE_NAME ".clone."
+#define CLONE_NAME_LEN strlen (CLONE_NAME)
+
+ if (strlen (name) > CLONE_NAME_LEN
+ && strncmp (name, CLONE_NAME, CLONE_NAME_LEN) == 0)
+ name += CLONE_NAME_LEN - 1;
- /* Do not discard nested subprograms (those
- which end with .NNN, where N are digits). */
for (name++; *name; name++)
- if (! ISDIGIT (*name))
+ if (digit_seen && *name == '.')
+ break;
+ else if (ISDIGIT (*name))
+ digit_seen = 1;
+ else
return 0;
-
- break;
}
}