This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: DWARF question
Carlos Eduardo Seo <cseo at linux.vnet.ibm.com> writes:
> Jim Blandy wrote:
>> The real question here is, why isn't find_line_symtab doing its job?
>> Its comment says:
>>
>> /* Find line number LINE in any symtab whose name is the same as
>> SYMTAB.
>>
>> If found, return the symtab that contains the linetable in which
> it was
>> found, set *INDEX to the index in the linetable of the best entry
>> found, and set *EXACT_MATCH nonzero if the value returned is an
>> exact match.
>>
>> If not found, return NULL. */
>>
>> That sounds to me like it's meant to address exactly the case we have
>> here. Could you take a look and tell us what you find?
>>
> Good point Jim. I'll take a look at that. The only thing I noticed in
> that function is that best_index always returns -1 when I try to set a
> breakpoint by line number in that function. I'm going deeper into that
> now.
>
> One point I forgot to mention and I think it's relevant is that when I
> load the binary with option '-readnow', that breakpoint by line number
> in the function works.
What probably happens is that '-readnow' somehow affects the order in
which the full symtabs get put in the list. I'm surprised that
breakpoints by line number in both main and the function work, but I
guess that has something to do with the nature of the bug in
find_line_symtab.