From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30173 invoked by alias); 30 Jun 2004 16:33:41 -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 30151 invoked from network); 30 Jun 2004 16:33:41 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 30 Jun 2004 16:33:41 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1Bfi1c-0005nE-AZ; Wed, 30 Jun 2004 12:33:32 -0400 Date: Wed, 30 Jun 2004 16:39:00 -0000 From: Daniel Jacobowitz To: Paul Koning Cc: gdb@sources.redhat.com Subject: Re: Getting gdb to find definitions Message-ID: <20040630163331.GA22175@nevyn.them.org> Mail-Followup-To: Paul Koning , gdb@sources.redhat.com References: <16609.36282.383014.108683@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16609.36282.383014.108683@gargle.gargle.HOWL> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-06/txt/msg00302.txt.bz2 On Tue, Jun 29, 2004 at 11:41:46AM -0400, Paul Koning wrote: > There's a problem I'm seeing increasingly often with GDB 6.1 -- > especially now that our compilers are switching to Dwarf-2 format. It > seems that gdb doesn't load definitions of types until you reference > some variable that causes it to load the symbols for a particular > source file -- or something like that. > > For example, I might do this: > > (gdb) file netbsd.gdb > Reading symbols from netbsd.gdb...done. > (gdb) ptype struct user > No struct type named user. > (gdb) p curproc > $1 = (struct proc *) 0x8282e9e0 > (gdb) ptype struct user > type = struct user { > struct pcb u_pcb; > struct pstats u_stats; > } > > This is causing a lot of confusion among users, and it breaks various > scripts. > > I would argue that gdb should read the definitions of types when they > are mentioned (as it does with the definitions of variables). Either > that, or it shouldn't default to delayed loading, if it causes > malfunctions like this. GDB is supposed to do this. If you've found a case where it doesn't work, please do provide a testcase. > Is there a fix for this? Alternatively, is there a way to at least > change the default symbol loading rule? -readnow. -- Daniel Jacobowitz