* corefile.c (core_sym_class): Allow for multiple iterations of
clone clones and subprograms.
This commit is contained in:
parent
316a8b2145
commit
f36485f09d
2 changed files with 22 additions and 9 deletions
|
@ -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>
|
2011-04-28 Jonathan Nieder <jrnieder@gmail.com>
|
||||||
|
|
||||||
* cg_print.c (print_header): Add no-c-format comment to prevent
|
* cg_print.c (print_header): Add no-c-format comment to prevent
|
||||||
|
|
|
@ -387,19 +387,27 @@ core_sym_class (asymbol *sym)
|
||||||
if (*name == '$')
|
if (*name == '$')
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (*name == '.')
|
while (*name == '.')
|
||||||
{
|
{
|
||||||
/* Allow GCC cloned functions. */
|
/* Allow both nested subprograms (which end with ".NNN", where N is
|
||||||
if (strlen (name) > 7 && strncmp (name, ".clone.", 7) == 0)
|
a digit) and GCC cloned functions (which contain ".clone").
|
||||||
name += 6;
|
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++)
|
for (name++; *name; name++)
|
||||||
if (! ISDIGIT (*name))
|
if (digit_seen && *name == '.')
|
||||||
return 0;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
else if (ISDIGIT (*name))
|
||||||
|
digit_seen = 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue