From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14463 invoked by alias); 20 Jul 2005 16:17:12 -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 14291 invoked by uid 22791); 20 Jul 2005 16:17:01 -0000 Received: from smtp108.sbc.mail.mud.yahoo.com (HELO smtp108.sbc.mail.mud.yahoo.com) (68.142.198.207) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Wed, 20 Jul 2005 16:17:01 +0000 Received: (qmail 84241 invoked from network); 20 Jul 2005 16:15:48 -0000 Received: from unknown (HELO lucon.org) (hjjean@sbcglobal.net@69.232.224.217 with login) by smtp108.sbc.mail.mud.yahoo.com with SMTP; 20 Jul 2005 16:15:47 -0000 Received: by lucon.org (Postfix, from userid 1000) id DF98964264; Wed, 20 Jul 2005 09:15:46 -0700 (PDT) Date: Wed, 20 Jul 2005 16:17:00 -0000 From: "H. J. Lu" To: Paul Koning Cc: drow@false.org, gdb@sources.redhat.com Subject: Re: find_pc_partial_function may produce the wrong answer Message-ID: <20050720161546.GA27852@lucon.org> References: <17118.24446.528000.56862@gargle.gargle.HOWL> <20050720143326.GA31003@nevyn.them.org> <17118.28560.210105.359439@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17118.28560.210105.359439@gargle.gargle.HOWL> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-07/txt/msg00210.txt.bz2 On Wed, Jul 20, 2005 at 11:36:48AM -0400, Paul Koning wrote: > >>>>> "Daniel" == Daniel Jacobowitz writes: > > Daniel> On Wed, Jul 20, 2005 at 10:28:14AM -0400, Paul Koning wrote: > >> I was tracking down a problem in my (modified) gdb, which showed > >> up when doing callstack tracing by reading the prologue. > >> (mips-tdep can do that, and in my version it does it most of the > >> time.) > >> > >> The problem is that find_pc_partial_function is used to find the > >> start of the function, and it was producing the wrong answer. > >> Specifically, it produces the wrong answer when the function is in > >> a shared library. > >> > >> The cause of the problem is that find_pc_partial_function looks up > >> the symbol in the msymtab, and that contains only external > >> symbols, not static symbols. The comments in the source code > >> explicitly claim that it DOES contain static symbols, but "maint > >> print msymtab" clearly shows that it doesn't. At least not for > >> MIPS shared libraries... > > Daniel> Is the shared library stripped? I am absolutely positive > Daniel> that the minimal symbol table will include the static symtab > Daniel> - as long as there is one. > > Daniel> If for some reason in your modified GDB this is not the case, > Daniel> figure out why not. > > It isn't related to the modified gdb; the stock gdb from CVS sources > does the same. > > It looks instead like there is something bizarre going on in the > compile. I looked in the build directory and found that the offending > file (malloc.o) has no static syms in its symbol table according to > readelf. But when I repeat the compile by hand I get a rather > different looking symbol table that does have them. Need to track > this down. Are you using gcc 4.0/4.1 by any chance? H.J.