From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5712 invoked by alias); 27 Oct 2009 19:43:24 -0000 Received: (qmail 5703 invoked by uid 22791); 27 Oct 2009 19:43:24 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f192.google.com (HELO mail-pz0-f192.google.com) (209.85.222.192) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Oct 2009 19:43:16 +0000 Received: by pzk30 with SMTP id 30so43363pzk.24 for ; Tue, 27 Oct 2009 12:43:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.21.33 with SMTP id y33mr1255886wfi.174.1256672593978; Tue, 27 Oct 2009 12:43:13 -0700 (PDT) In-Reply-To: <20091027193731.GA16615@caradoc.them.org> References: <668c430c0910271132j48e478d6s88aeb51282229402@mail.gmail.com> <8ac60eac0910271140n54923a92u74bd2a909ed05696@mail.gmail.com> <668c430c0910271156m29e5770dyec6de9afa84f01f7@mail.gmail.com> <20091027192701.GA14984@caradoc.them.org> <668c430c0910271233m35b959bepb91df230b6c05ced@mail.gmail.com> <20091027193731.GA16615@caradoc.them.org> Date: Tue, 27 Oct 2009 20:03:00 -0000 Message-ID: <668c430c0910271243l194e6022va045362c830c9662@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/msg00399.txt.bz2 On Tue, Oct 27, 2009 at 12:37 PM, Daniel Jacobowitz wrote: > On Tue, Oct 27, 2009 at 12:33:39PM -0700, Bruce Korb wrote: >> Exactly. =A0I know it'd be some work. =A0I think I need to >> call: =A0dlopen(NULL, RTLD_NOW) > > No. =A0You need to open the file and have your own ELF and symbol table > reader. =A0They are not in the area mapped by dlopen. OK. Still not terribly hard: { static char const exe_fmt[] =3D "/proc/%d/exe"; char bf[sizeof (exe_fmt) + 12]; sprintf(bf, exe_fmt, getpid()); path_len =3D readlink(bf, exe_path, sizeof (exe_path) - 1); } (This is for Linux only...) > GDB is almost certainly not where you want to get this code from. =A0We > just use BFD... Ah! There we go. That's what I was looking for. Thank you!