This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: DWARF question
- From: Jim Blandy <jimb at codesourcery dot com>
- To: Carlos Eduardo Seo <cseo at linux dot vnet dot ibm dot com>
- Cc: gdb at sourceware dot org, drow at false dot org
- Date: Tue, 02 Oct 2007 13:03:10 -0700
- Subject: Re: DWARF question
- References: <46FAC9D7.9080001@linux.vnet.ibm.com> <20070926212539.GA17502@caradoc.them.org> <46FAD46B.9000006@br.ibm.com> <46FD5A9B.2070004@linux.vnet.ibm.com> <m3r6ki5xwm.fsf@codesourcery.com> <46FD7AE9.8030208@linux.vnet.ibm.com> <m34pheqt6u.fsf@codesourcery.com> <4701333C.9040705@linux.vnet.ibm.com>
Carlos Eduardo Seo <cseo at linux.vnet.ibm.com> writes:
> Jim Blandy wrote:
>>
>> 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.
> Here's what I got. The loop 'ALL_SYMTABS' has only one iteration
> because 's->next' is NULL. So it seems that GDB isn't loading the
> other symtab.
>
> When I use '-readnow', both symtabs are there:
>
> (top-gdb) p s->filename
> $6 = 0x106a4930 "init.c"
> (top-gdb) p (s->next)->filename
> $7 = 0x1069cf10 "/usr/src/packages/BUILD/glibc-2.4/cc-nptl/csu/crti.S"
> (top-gdb) p ((s->next)->next)->filename
> $8 = 0x1069cc60 "test-main.f"
> (top-gdb) p (((s->next)->next)->next)->filename
> $9 = 0x1069c280 "test-main.f"
> (top-gdb) p ((((s->next)->next)->next)->next)->filename
> $10 = 0x1068d5c0 "crtsavres.S"
> (top-gdb) p (((((s->next)->next)->next)->next)->next)->filename
> $11 = 0x1068d2a0 "/usr/src/packages/BUILD/glibc-2.4/cc-nptl/csu/crtn.S"
> (top-gdb) p (((((s->next)->next)->next)->next)->next)->next
> $17 = (struct symtab *) 0x0
By the way, you might want to try using 'maint info symtabs' and
'maint info psymtabs'. You can give it a regexp to restrict the
symtabs it lists. It gives you expressions you can copy and paste
into the GDB debugging GDB if you want to look into something in more
detail.