find_pc_partial_function may produce the wrong answer
Daniel Jacobowitz
drow@false.org
Wed Jul 20 14:33:00 GMT 2005
On Wed, Jul 20, 2005 at 10:28:14AM -0400, Paul Koning wrote:
> I was tracking down a problem in my (modified) gdb, which showed up
> when doing callstack tracing by reading the prologue. (mips-tdep can
> do that, and in my version it does it most of the time.)
>
> The problem is that find_pc_partial_function is used to find the start
> of the function, and it was producing the wrong answer. Specifically,
> it produces the wrong answer when the function is in a shared library.
>
> The cause of the problem is that find_pc_partial_function looks up the
> symbol in the msymtab, and that contains only external symbols, not
> static symbols. The comments in the source code explicitly claim that
> it DOES contain static symbols, but "maint print msymtab" clearly
> shows that it doesn't. At least not for MIPS shared libraries...
Is the shared library stripped? I am absolutely positive that the
minimal symbol table will include the static symtab - as long as there
is one.
If for some reason in your modified GDB this is not the case, figure
out why not.
--
Daniel Jacobowitz
CodeSourcery, LLC
More information about the Gdb
mailing list