From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22199 invoked by alias); 15 Jun 2004 22:53:13 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22192 invoked from network); 15 Jun 2004 22:53:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 15 Jun 2004 22:53:12 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i5FMrCe1013296 for ; Tue, 15 Jun 2004 18:53:12 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i5FMr9009213; Tue, 15 Jun 2004 18:53:10 -0400 To: Bob Rossi Cc: gdb@sources.redhat.com Subject: Re: -file-list-exec-source-files && libraries References: <20040611182915.GA15256@white> <20040611183510.GB15256@white> From: Jim Blandy Date: Tue, 15 Jun 2004 22:53:00 -0000 In-Reply-To: <20040611183510.GB15256@white> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-06/txt/msg00163.txt.bz2 Bob Rossi 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 * 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.