* corefile.c (core_create_function_syms): Remove "<locore>" and
"<hicore>" sentinels. * gprof.c: Likewise. * cg_print.c (cg_print_function_ordering): Likewise. * alpha.c (alpha_find_call): Add check for return value of sym_lookup. * mips.c (mips_find_call): Likewise. * sparc.c (sparc_find_call): Likewise. * tahoe.c (tahoe_find_call): Likewise. * vax.c (vax_find_call): Likewise.
This commit is contained in:
parent
5d7cb8dff5
commit
d401d98a57
|
@ -1,3 +1,15 @@
|
||||||
|
2009-02-12 Ken Werner <ken.werner@de.ibm.com>
|
||||||
|
|
||||||
|
* corefile.c (core_create_function_syms): Remove "<locore>" and
|
||||||
|
"<hicore>" sentinels.
|
||||||
|
* gprof.c: Likewise.
|
||||||
|
* cg_print.c (cg_print_function_ordering): Likewise.
|
||||||
|
* alpha.c (alpha_find_call): Add check for return value of sym_lookup.
|
||||||
|
* mips.c (mips_find_call): Likewise.
|
||||||
|
* sparc.c (sparc_find_call): Likewise.
|
||||||
|
* tahoe.c (tahoe_find_call): Likewise.
|
||||||
|
* vax.c (vax_find_call): Likewise.
|
||||||
|
|
||||||
2009-02-03 Carlos O'Donell <carlos@codesourcery.com>
|
2009-02-03 Carlos O'Donell <carlos@codesourcery.com>
|
||||||
|
|
||||||
* configure.in: AC_SUBST pdfdir.
|
* configure.in: AC_SUBST pdfdir.
|
||||||
|
|
|
@ -148,17 +148,20 @@ alpha_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
if (hist_check_address (dest_pc))
|
if (hist_check_address (dest_pc))
|
||||||
{
|
{
|
||||||
child = sym_lookup (&symtab, dest_pc);
|
child = sym_lookup (&symtab, dest_pc);
|
||||||
DBG (CALLDEBUG,
|
if (child)
|
||||||
printf (" 0x%lx\t; name=%s, addr=0x%lx",
|
{
|
||||||
(unsigned long) dest_pc, child->name,
|
DBG (CALLDEBUG,
|
||||||
(unsigned long) child->addr));
|
printf (" 0x%lx\t; name=%s, addr=0x%lx",
|
||||||
if (child->addr == dest_pc || child->addr == dest_pc - 8)
|
(unsigned long) dest_pc, child->name,
|
||||||
{
|
(unsigned long) child->addr));
|
||||||
DBG (CALLDEBUG, printf ("\n"));
|
if (child->addr == dest_pc || child->addr == dest_pc - 8)
|
||||||
/* a hit: */
|
{
|
||||||
arc_add (parent, child, (unsigned long) 0);
|
DBG (CALLDEBUG, printf ("\n"));
|
||||||
continue;
|
/* a hit: */
|
||||||
}
|
arc_add (parent, child, (unsigned long) 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Something funny going on.
|
* Something funny going on.
|
||||||
|
|
|
@ -804,13 +804,8 @@ cg_print_function_ordering ()
|
||||||
{
|
{
|
||||||
if (symtab.base[index].ncalls == 0)
|
if (symtab.base[index].ncalls == 0)
|
||||||
{
|
{
|
||||||
/* Filter out gprof generated names. */
|
unused_syms[unused++] = &symtab.base[index];
|
||||||
if (strcmp (symtab.base[index].name, "<locore>")
|
symtab.base[index].has_been_placed = 1;
|
||||||
&& strcmp (symtab.base[index].name, "<hicore>"))
|
|
||||||
{
|
|
||||||
unused_syms[unused++] = &symtab.base[index];
|
|
||||||
symtab.base[index].has_been_placed = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -480,8 +480,7 @@ core_create_function_syms ()
|
||||||
done (1);
|
done (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The "+ 2" is for the sentinels. */
|
symtab.base = (Sym *) xmalloc (symtab.len * sizeof (Sym));
|
||||||
symtab.base = (Sym *) xmalloc ((symtab.len + 2) * sizeof (Sym));
|
|
||||||
|
|
||||||
/* Pass 2 - create symbols. */
|
/* Pass 2 - create symbols. */
|
||||||
symtab.limit = symtab.base;
|
symtab.limit = symtab.base;
|
||||||
|
@ -597,19 +596,6 @@ core_create_function_syms ()
|
||||||
++symtab.limit;
|
++symtab.limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create sentinels. */
|
|
||||||
sym_init (symtab.limit);
|
|
||||||
symtab.limit->name = "<locore>";
|
|
||||||
symtab.limit->addr = 0;
|
|
||||||
symtab.limit->end_addr = min_vma - 1;
|
|
||||||
++symtab.limit;
|
|
||||||
|
|
||||||
sym_init (symtab.limit);
|
|
||||||
symtab.limit->name = "<hicore>";
|
|
||||||
symtab.limit->addr = max_vma + 1;
|
|
||||||
symtab.limit->end_addr = ~(bfd_vma) 0;
|
|
||||||
++symtab.limit;
|
|
||||||
|
|
||||||
symtab.len = symtab.limit - symtab.base;
|
symtab.len = symtab.limit - symtab.base;
|
||||||
symtab_finalize (&symtab);
|
symtab_finalize (&symtab);
|
||||||
}
|
}
|
||||||
|
@ -623,7 +609,7 @@ core_create_line_syms ()
|
||||||
char *prev_name, *prev_filename;
|
char *prev_name, *prev_filename;
|
||||||
unsigned int prev_name_len, prev_filename_len;
|
unsigned int prev_name_len, prev_filename_len;
|
||||||
bfd_vma vma, min_vma = ~(bfd_vma) 0, max_vma = 0;
|
bfd_vma vma, min_vma = ~(bfd_vma) 0, max_vma = 0;
|
||||||
Sym *prev, dummy, *sentinel, *sym;
|
Sym *prev, dummy, *sym;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
int prev_line_num;
|
int prev_line_num;
|
||||||
Sym_Table ltab;
|
Sym_Table ltab;
|
||||||
|
@ -744,7 +730,8 @@ core_create_line_syms ()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sym = sym_lookup(&symtab, ltab.limit->addr);
|
sym = sym_lookup(&symtab, ltab.limit->addr);
|
||||||
ltab.limit->is_static = sym->is_static;
|
if (sym)
|
||||||
|
ltab.limit->is_static = sym->is_static;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = ltab.limit;
|
prev = ltab.limit;
|
||||||
|
@ -756,21 +743,6 @@ core_create_line_syms ()
|
||||||
++ltab.limit;
|
++ltab.limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update sentinels. */
|
|
||||||
sentinel = sym_lookup (&symtab, (bfd_vma) 0);
|
|
||||||
|
|
||||||
if (sentinel
|
|
||||||
&& strcmp (sentinel->name, "<locore>") == 0
|
|
||||||
&& min_vma <= sentinel->end_addr)
|
|
||||||
sentinel->end_addr = min_vma - 1;
|
|
||||||
|
|
||||||
sentinel = sym_lookup (&symtab, ~(bfd_vma) 0);
|
|
||||||
|
|
||||||
if (sentinel
|
|
||||||
&& strcmp (sentinel->name, "<hicore>") == 0
|
|
||||||
&& max_vma >= sentinel->addr)
|
|
||||||
sentinel->addr = max_vma + 1;
|
|
||||||
|
|
||||||
/* Copy in function symbols. */
|
/* Copy in function symbols. */
|
||||||
memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
|
memcpy (ltab.limit, symtab.base, symtab.len * sizeof (Sym));
|
||||||
ltab.limit += symtab.len;
|
ltab.limit += symtab.len;
|
||||||
|
|
|
@ -84,7 +84,6 @@ static char *default_excluded_list[] =
|
||||||
{
|
{
|
||||||
"_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcount_internal",
|
"_gprof_mcount", "mcount", "_mcount", "__mcount", "__mcount_internal",
|
||||||
"__mcleanup",
|
"__mcleanup",
|
||||||
"<locore>", "<hicore>",
|
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
21
gprof/mips.c
21
gprof/mips.c
|
@ -74,16 +74,19 @@ mips_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
if (hist_check_address (dest_pc))
|
if (hist_check_address (dest_pc))
|
||||||
{
|
{
|
||||||
child = sym_lookup (&symtab, dest_pc);
|
child = sym_lookup (&symtab, dest_pc);
|
||||||
DBG (CALLDEBUG,
|
if (child)
|
||||||
printf (" 0x%lx\t; name=%s, addr=0x%lx",
|
|
||||||
(unsigned long) dest_pc, child->name,
|
|
||||||
(unsigned long) child->addr));
|
|
||||||
if (child->addr == dest_pc)
|
|
||||||
{
|
{
|
||||||
DBG (CALLDEBUG, printf ("\n"));
|
DBG (CALLDEBUG,
|
||||||
/* a hit: */
|
printf (" 0x%lx\t; name=%s, addr=0x%lx",
|
||||||
arc_add (parent, child, (unsigned long) 0);
|
(unsigned long) dest_pc, child->name,
|
||||||
continue;
|
(unsigned long) child->addr));
|
||||||
|
if (child->addr == dest_pc)
|
||||||
|
{
|
||||||
|
DBG (CALLDEBUG, printf ("\n"));
|
||||||
|
/* a hit: */
|
||||||
|
arc_add (parent, child, (unsigned long) 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Something funny going on. */
|
/* Something funny going on. */
|
||||||
|
|
|
@ -68,15 +68,18 @@ sparc_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
if (hist_check_address (dest_pc))
|
if (hist_check_address (dest_pc))
|
||||||
{
|
{
|
||||||
child = sym_lookup (&symtab, dest_pc);
|
child = sym_lookup (&symtab, dest_pc);
|
||||||
DBG (CALLDEBUG,
|
if (child)
|
||||||
printf ("\tdest_pc=0x%lx, (name=%s, addr=0x%lx)\n",
|
|
||||||
(unsigned long) dest_pc, child->name,
|
|
||||||
(unsigned long) child->addr));
|
|
||||||
if (child->addr == dest_pc)
|
|
||||||
{
|
{
|
||||||
/* a hit: */
|
DBG (CALLDEBUG,
|
||||||
arc_add (parent, child, (unsigned long) 0);
|
printf ("\tdest_pc=0x%lx, (name=%s, addr=0x%lx)\n",
|
||||||
continue;
|
(unsigned long) dest_pc, child->name,
|
||||||
|
(unsigned long) child->addr));
|
||||||
|
if (child->addr == dest_pc)
|
||||||
|
{
|
||||||
|
/* a hit: */
|
||||||
|
arc_add (parent, child, (unsigned long) 0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -298,21 +298,24 @@ tahoe_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
if (hist_check_address (destpc))
|
if (hist_check_address (destpc))
|
||||||
{
|
{
|
||||||
child = sym_lookup (&symtab, destpc);
|
child = sym_lookup (&symtab, destpc);
|
||||||
DBG (CALLDEBUG,
|
if (child)
|
||||||
printf ("[findcall]\tdestpc 0x%lx",
|
|
||||||
(unsigned long) destpc);
|
|
||||||
printf (" child->name %s", child->name);
|
|
||||||
printf (" child->addr 0x%lx\n",
|
|
||||||
(unsigned long) child->addr);
|
|
||||||
);
|
|
||||||
if (child->addr == destpc)
|
|
||||||
{
|
{
|
||||||
/*
|
DBG (CALLDEBUG,
|
||||||
* a hit
|
printf ("[findcall]\tdestpc 0x%lx",
|
||||||
*/
|
(unsigned long) destpc);
|
||||||
arc_add (parent, child, (unsigned long) 0);
|
printf (" child->name %s", child->name);
|
||||||
length += tahoe_operandlength (instructp + length);
|
printf (" child->addr 0x%lx\n",
|
||||||
continue;
|
(unsigned long) child->addr);
|
||||||
|
);
|
||||||
|
if (child->addr == destpc)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* a hit
|
||||||
|
*/
|
||||||
|
arc_add (parent, child, (unsigned long) 0);
|
||||||
|
length += tahoe_operandlength (instructp + length);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
goto botched;
|
goto botched;
|
||||||
}
|
}
|
||||||
|
|
31
gprof/vax.c
31
gprof/vax.c
|
@ -309,21 +309,24 @@ vax_find_call (Sym *parent, bfd_vma p_lowpc, bfd_vma p_highpc)
|
||||||
if (hist_check_address (destpc))
|
if (hist_check_address (destpc))
|
||||||
{
|
{
|
||||||
child = sym_lookup (&symtab, destpc);
|
child = sym_lookup (&symtab, destpc);
|
||||||
DBG (CALLDEBUG,
|
if (child)
|
||||||
printf ("[findcall]\tdestpc 0x%lx",
|
|
||||||
(unsigned long) destpc);
|
|
||||||
printf (" child->name %s", child->name);
|
|
||||||
printf (" child->addr 0x%lx\n",
|
|
||||||
(unsigned long) child->addr);
|
|
||||||
);
|
|
||||||
if (child->addr == destpc)
|
|
||||||
{
|
{
|
||||||
/*
|
DBG (CALLDEBUG,
|
||||||
* a hit
|
printf ("[findcall]\tdestpc 0x%lx",
|
||||||
*/
|
(unsigned long) destpc);
|
||||||
arc_add (parent, child, (unsigned long) 0);
|
printf (" child->name %s", child->name);
|
||||||
length += vax_operandlength (instructp + length);
|
printf (" child->addr 0x%lx\n",
|
||||||
continue;
|
(unsigned long) child->addr);
|
||||||
|
);
|
||||||
|
if (child->addr == destpc)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* a hit
|
||||||
|
*/
|
||||||
|
arc_add (parent, child, (unsigned long) 0);
|
||||||
|
length += vax_operandlength (instructp + length);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
goto botched;
|
goto botched;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue