This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Display libc function names instead of address ?


On Thu, Jun 16, 2005 at 09:56:11PM +0200, Eli Zaretskii wrote:
> > 0x0807c0ac <captured_main+76>:  mov    %eax,0x4(%esp)
> > 0x0807c0b0 <captured_main+80>:  movl   $0x5,(%esp)
> > 0x0807c0b7 <captured_main+87>:  call   0x807b3a0 <setlocale@plt>
> > 0x0807c0bc <captured_main+92>:  movl   $0x0,(%esp)
> > 0x0807c0c3 <captured_main+99>:  mov    $0x8239443,%eax
> > 0x0807c0c8 <captured_main+104>: mov    %eax,0x4(%esp)
> > 0x0807c0cc <captured_main+108>: call   0x807b3a0 <setlocale@plt>
> 
> 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 <captured_main+91>:  call   0x8079bec <setlocale>
> 
> 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 <main+341>:  movl   $0x1,0xffffffd4(%ebp)
>     0x01002174 <main+348>:  movl   $0x128a50f,0x4(%esp)
>     0x0100217c <main+356>:  movl   $0x0,(%esp)
>     0x01002183 <main+363>:  call   0x114f7e0 <setlocale>

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]