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

> Date: Thu, 16 Jun 2005 14:29:36 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: victor.stinner@haypocalc.com, gdb@sources.redhat.com
> 
> 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>

I don't understand: what is this "setlocale@plt" thingy?

Anyway, I tried this with GDB 6.1 on a Debian box and saw this:

    0x0807a8ab <captured_main+75>:  mov    %eax,0xffffff10(%ebp)
    0x0807a8b1 <captured_main+81>:  add    $0xfffffff8,%esp
    0x0807a8b4 <captured_main+84>:  push   $0x81ca040
    0x0807a8b9 <captured_main+89>:  push   $0x5
    0x0807a8bb <captured_main+91>:  call   0x8079bec <setlocale>
    0x0807a8c0 <captured_main+96>:  add    $0xfffffff8,%esp
    0x0807a8c3 <captured_main+99>:  push   $0x81ca040
    0x0807a8c8 <captured_main+104>: push   $0x0
    0x0807a8ca <captured_main+106>: call   0x8079bec <setlocale>
    0x0807a8cf <captured_main+111>: add    $0x20,%esp
    0x0807a8d2 <captured_main+114>: add    $0xfffffff8,%esp
    0x0807a8d5 <captured_main+117>: push   $0x81ca041

which seems to show the names of library functions just fine.

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>
    ...
    0x010021e1 <main+457>:  movl   $0x0,(%esp)
    0x010021e8 <main+464>:  call   0x114f7c0 <_isatty>
    ...
    0x010021f5 <main+477>:  mov    0xffffffe4(%ebp),%eax
    0x010021f8 <main+480>:  movl   $0x128a646,0x4(%esp)
    0x01002200 <main+488>:  mov    %eax,0x8(%esp)
    0x01002204 <main+492>:  mov    0x12fab38,%eax
    0x01002209 <main+497>:  add    $0x40,%eax
    0x0100220c <main+500>:  mov    %eax,(%esp)
    0x0100220f <main+503>:  call   0x114f830 <fprintf>

which again shows library functions with their full name.

So I'm unsure what is the problem.  Am I missing something?


  reply	other threads:[~2005-06-16 18:56 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
2005-06-16 18:56     ` Eli Zaretskii [this message]
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=uwtou13fo.fsf@gnu.org \
    --to=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