From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17450 invoked by alias); 20 May 2003 21:34:33 -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 17402 invoked from network); 20 May 2003 21:34:32 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 20 May 2003 21:34:32 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id h4KLYQW32370; Tue, 20 May 2003 14:34:26 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Brian Ford Cc: gdb@sources.redhat.com Subject: Re: DWARF2 PE/COFF port and parsing ? References: From: David Carlton Date: Tue, 20 May 2003 21:34:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00277.txt.bz2 On Tue, 20 May 2003 16:14:32 -0500 (CDT), Brian Ford said: > I'm still slowly trying to add DWARF2 support for PE/COFF targets. I have > the following problem that confuses me and I was hoping for some expert > guidance about how to proceed. gdb's symbol table code is completely > foreign to me. > If I load an executable into gdb that contains one object file with DWARF2 > information (all the rest stabs), I get a segfault here: > 1431 if (!do_linear_search > 1432 && (SYMBOL_LANGUAGE (*center) == language_java)) > 1433 { > 1434 do_linear_search = 1; > 1435 } The above code really should be deleted from the function in question, but never mind that; at least it's being a useful canary in the coal mine. > (gdb) p *center > $1 = (struct partial_symbol *) 0x20 That's bad: 0x20 doesn't look like an address. So the partial symbol table in question is screwed up. Unfortunately, by the time you hit this bug, we've long since built the partial symbol tables. For an example of building a partial symbol table, see dwarf2read.c:dwarf2_build_psymtabs_hard. It gets created with start_psymtab_common, then some fields get set, then a function gets called (scan_partial_symbols, in this case) that eventually translates into a bunch of calls to add_psymbol_to_list to add the actual partial symbols, then the number of global and static symbols get set, then sort_pst_symbols gets called. From your symptoms, maybe the number of global and/or static symbols got set wrong (or not at all) somewhere. What does "p *pst" say? Unfortunately, the bug may have occurred when another psymtab was being generated: all the psymtabs within one objfile share one data structure, so an error when generating one psymtab may corrupt another psymtab's data. (Sigh. Partial symbol tables are a mess.) If this doesn't help, maybe you could give some more details about exactly how you've been tinkering with the readers. David Carlton carlton@math.stanford.edu