This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: find_pc_partial_function may produce the wrong answer
- From: Daniel Jacobowitz <drow at false dot org>
- To: Paul Koning <pkoning at equallogic dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 20 Jul 2005 10:33:26 -0400
- Subject: Re: find_pc_partial_function may produce the wrong answer
- References: <17118.24446.528000.56862@gargle.gargle.HOWL>
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