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:21:09PM +0200, Eli Zaretskii wrote:
> > Date: Thu, 16 Jun 2005 05:36:00 +0200
> > From: Victor STINNER <victor.stinner@haypocalc.com>
> > 
> > I woud like to know if it is possible to display libc functions name
> > instead of their address. Example :
> > 
> > (1) (...) // prepare parameters
> >     call 0x8048728
> > 
> > (2) jmp *0x804a6b0 // in relocation table, at 0x08048728
> 
> In response of what command(s) would you like to see the function
> names?  Can you post an example of a command and its current output?

Here's an example of the effect of the patch I just posted to
gdb-patches.  With an unpatched GDB, load gdb on a Linux system and run
"disas captured_main":

0x0807c0ac <captured_main+76>:  mov    %eax,0x4(%esp)
0x0807c0b0 <captured_main+80>:  movl   $0x5,(%esp)
0x0807c0b7 <captured_main+87>:  call   0x807b3a0 <_init+952>
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 <_init+952>

With the patch applied:

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>

This doesn't work absolutely everywhere, of course.  It requires
target-specific support inside BFD.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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