From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31411 invoked by alias); 27 Oct 2009 19:33:45 -0000 Received: (qmail 31377 invoked by uid 22791); 27 Oct 2009 19:33:43 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f175.google.com (HELO mail-px0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Oct 2009 19:33:41 +0000 Received: by pxi5 with SMTP id 5so36796pxi.12 for ; Tue, 27 Oct 2009 12:33:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.25.39 with SMTP id c39mr1389375wfj.10.1256672019469; Tue, 27 Oct 2009 12:33:39 -0700 (PDT) In-Reply-To: <20091027192701.GA14984@caradoc.them.org> References: <668c430c0910271132j48e478d6s88aeb51282229402@mail.gmail.com> <8ac60eac0910271140n54923a92u74bd2a909ed05696@mail.gmail.com> <668c430c0910271156m29e5770dyec6de9afa84f01f7@mail.gmail.com> <20091027192701.GA14984@caradoc.them.org> Date: Tue, 27 Oct 2009 19:37:00 -0000 Message-ID: <668c430c0910271233m35b959bepb91df230b6c05ced@mail.gmail.com> Subject: Re: How does one get static procedure names? From: Bruce Korb To: Bruce Korb , Paul Pluzhnikov , gdb@sourceware.org, gdb@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00397.txt.bz2 On Tue, Oct 27, 2009 at 12:27 PM, Daniel Jacobowitz wrote: > On Tue, Oct 27, 2009 at 11:56:46AM -0700, Bruce Korb wrote: >> Sorry. =A0 When you do a "bt" using gdb, you see the function >> names, whether they be "static" or have global (external) >> linkage. =A0The function backtrace_symbols(), on the other >> hand, doe *not* print static scope function names. =A0Even if >> it takes some work, I'd like to "fix" the constraint. =A0However, >> I wasn't able to decipher the gdb source well enough to figure >> out how it accomplished this feat. =A0So, is there some place >> in the GDB source where I ought to be looking? > > You can't readily do so. =A0backtrace_symbols is using the dynamic > symbol table, which is loaded into memory. =A0Local symbols are not > added to the dynamic symbol table. > > GDB reads both the local symbol table and the DWARF/stabs debug > information. > > You'd need an additional symbol table reader which read them off disk > instead of out of RAM. Exactly. I know it'd be some work. I think I need to call: dlopen(NULL, RTLD_NOW) and then copy & fiddle code out of GDB. yes? :) Or, do I have to figure out the actual file name and replace NULL with that file name? Either way....now what? Just point me to some code & I ought to be okay.