From: Jim Blandy <jimb@redhat.com>
To: Bob Rossi <bob@brasko.net>
Cc: gdb@sources.redhat.com
Subject: Re: -file-list-exec-source-files && libraries
Date: Tue, 15 Jun 2004 22:53:00 -0000 [thread overview]
Message-ID: <vt2acz4zb7o.fsf@zenia.home> (raw)
In-Reply-To: <20040611183510.GB15256@white>
Bob Rossi <bob@brasko.net> writes:
> On Fri, Jun 11, 2004 at 02:29:16PM -0400, Bob Rossi wrote:
> > Hi,
> >
> > A user of -file-list-exec-source-files noticed that this command does
> > not initially list the files that are in a library. For example,
> >
> > I have
> > $ ls
> > Makefile lib.c lib.h lib.o libmilib.a main main.c
> >
> > And
> > $ cat Makefile
> > all:
> > gcc -c -g -Wall lib.c
> > ar cru libmilib.a lib.o
> > gcc -g -Wall main.c -o main -L. -lmilib -I.
> >
> > When I do -file-list-exec-source-files originally, it doesn't show
> > lib.c, after I do 'list lib.c:1' it will then show the filename. Also, I
> > believe it shows all of the filenames in the library.
> >
> > My question is, is there any way to get this funcionality from the get
> > go? Load the psymtabs for all the libraries?
> >
> > Or is there a GDB command that forces loading all symbols into the
> > partial symbol table at start?
>
> Unfortunatly, I forgot to add one thing. The files from all libraries do
> show up when the stabs debugging format is used. It seems like this is a
> dwarf2 problem. Anyone know if this is a bug?
>
> Or something maybe I could look into?
Hmm. The partial symbol tables ought to be listing every source file
mentioned in the program. Otherwise, when a user refers to a source
file by name (say, to set a breakpoint), GDB won't be able to tell
which compilation units' symbols to read in.
Dwarf 2 used to have a problem with this, but the following change
fixed that problem:
2004-05-03 J. Brobecker <brobecker@gnat.com>
* dwarf2read.c (line_header): Add new included_p field in
field file_names.
(partial_die_info): New field has_stmt_list. New field line_offset.
(dwarf2_create_include_psymtab): New function.
(dwarf2_build_include_psymtabs): New function.
(add_file_name): Add forward declaration. Initialize new field.
(dwarf_decode_lines): Add new parameter. Enhance this procedure
to be able to determine the list of files included by the
given unit, and build their associated psymtabs.
(dwarf2_build_psymtabs_hard): Build the psymtabs for the included
files as well.
(psymtab_to_symtab_1): Build the symtabs of all dependencies as well.
(read_file_scope): Update call to dwarf_decode_lines.
(read_partial_die): Handle DW_AT_stmt_list attributes.
So, does 'readelf -wl main' mention all the source files? It should.
Does 'maint info psymtabs' mention all the source files? It should,
too.
prev parent reply other threads:[~2004-06-15 22:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-11 18:29 Bob Rossi
2004-06-11 18:35 ` Bob Rossi
2004-06-12 2:14 ` info sources regression with dwarf2/stabs Bob Rossi
2004-06-15 13:51 ` Bob Rossi
2004-06-15 22:53 ` Jim Blandy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=vt2acz4zb7o.fsf@zenia.home \
--to=jimb@redhat.com \
--cc=bob@brasko.net \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox