Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: victor.stinner@haypocalc.com, gdb@sources.redhat.com
Subject: Re: Display libc function names instead of address ?
Date: Thu, 16 Jun 2005 18:29:00 -0000	[thread overview]
Message-ID: <20050616182936.GA4062@nevyn.them.org> (raw)
In-Reply-To: <u4qby2jmi.fsf@gnu.org>

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


  reply	other threads:[~2005-06-16 18:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-16  3:36 Victor STINNER
2005-06-16  4:43 ` Daniel Jacobowitz
2005-06-16 15:04   ` Victor STINNER
2005-06-16 15:20     ` Daniel Jacobowitz
2005-06-16 15:46       ` Victor STINNER
2005-06-16 18:21 ` Eli Zaretskii
2005-06-16 18:29   ` Daniel Jacobowitz [this message]
2005-06-16 18:56     ` Eli Zaretskii
2005-06-16 19:03       ` Daniel Jacobowitz
2005-06-17  9:44         ` Eli Zaretskii
2005-06-17 11:44           ` Victor STINNER
2005-06-17 13:56           ` Daniel Jacobowitz
2005-06-18 13:12           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050616182936.GA4062@nevyn.them.org \
    --to=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=victor.stinner@haypocalc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox