From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26613 invoked by alias); 16 Jun 2005 19:03:28 -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 26585 invoked by uid 22791); 16 Jun 2005 19:03:17 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 16 Jun 2005 19:03:17 +0000 Received: from drow by nevyn.them.org with local (Exim 4.51) id 1Dizdz-0001W3-2P; Thu, 16 Jun 2005 15:03:15 -0400 Date: Thu, 16 Jun 2005 19:03:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: victor.stinner@haypocalc.com, gdb@sources.redhat.com Subject: Re: Display libc function names instead of address ? Message-ID: <20050616190315.GA5572@nevyn.them.org> Mail-Followup-To: Eli Zaretskii , victor.stinner@haypocalc.com, gdb@sources.redhat.com References: <1118892960.12713.5.camel@haypopc> <20050616182936.GA4062@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00176.txt.bz2 On Thu, Jun 16, 2005 at 09:56:11PM +0200, Eli Zaretskii wrote: > > 0x0807c0ac : mov %eax,0x4(%esp) > > 0x0807c0b0 : movl $0x5,(%esp) > > 0x0807c0b7 : call 0x807b3a0 > > 0x0807c0bc : movl $0x0,(%esp) > > 0x0807c0c3 : mov $0x8239443,%eax > > 0x0807c0c8 : mov %eax,0x4(%esp) > > 0x0807c0cc : call 0x807b3a0 > > I don't understand: what is this "setlocale@plt" thingy? It's a "synthetic" symbol. It's not really in the symbol table; but BFD provides it as an informative marker. It means that the call instruction will go to a PLT entry for setlocale. > Anyway, I tried this with GDB 6.1 on a Debian box and saw this: > > 0x0807a8bb : call 0x8079bec > > which seems to show the names of library functions just fine. I haven't worked with Debian/woody in a bit, so I'd forgotten about this. If you try it on the new Debian stable release, you'll see the calls to _init. They're the result of a performance improvement in binutils. [I can go into more detail if you're curious. They would sometimes show up on the older binutils, but I can not remember the circumstances.] > I then tried this with GDB 6.3 and a MinGW build of Emacs on a > Windows XP box and saw things like this: > > 0x0100216d : movl $0x1,0xffffffd4(%ebp) > 0x01002174 : movl $0x128a50f,0x4(%esp) > 0x0100217c : movl $0x0,(%esp) > 0x01002183 : call 0x114f7e0 Yes, Windows is not affected by this problem - it's related to shared libraries and dynamic linking, and Windows DLL linking is different enough that it does not have this quirk - though I'm sure it has plenty of its own. -- Daniel Jacobowitz CodeSourcery, LLC