From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8301 invoked by alias); 20 Jul 2005 14:33: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 8285 invoked by uid 22791); 20 Jul 2005 14:33:29 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 20 Jul 2005 14:33:29 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1DvFdW-00084P-Bl; Wed, 20 Jul 2005 10:33:26 -0400 Date: Wed, 20 Jul 2005 14:33:00 -0000 From: Daniel Jacobowitz To: Paul Koning Cc: gdb@sources.redhat.com Subject: Re: find_pc_partial_function may produce the wrong answer Message-ID: <20050720143326.GA31003@nevyn.them.org> Mail-Followup-To: Paul Koning , gdb@sources.redhat.com References: <17118.24446.528000.56862@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17118.24446.528000.56862@gargle.gargle.HOWL> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00208.txt.bz2 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... Is the shared library stripped? I am absolutely positive that the minimal symbol table will include the static symtab - as long as there is one. If for some reason in your modified GDB this is not the case, figure out why not. -- Daniel Jacobowitz CodeSourcery, LLC