public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: gdb@sources.redhat.com
Subject: Consistent format for memory addresses
Date: Wed, 25 May 2005 03:18:00 -0000	[thread overview]
Message-ID: <17043.61074.262608.156551@farnswood.snap.net.nz> (raw)


At one stage, the GDB command "disassemble" output seven hex digits for memory
addresses on 32 bit Intel (GNU/Linux):

(gdb) disassemble main     
Dump of assembler code for function main:
0x80484c6 <main>:       push   %ebp
0x80484c7 <main+1>:     mov    %esp,%ebp
0x80484c9 <main+3>:     sub    $0x238,%esp
0x80484cf <main+9>:     and    $0xfffffff0,%esp
0x80484d2 <main+12>:    mov    $0x0,%eax
0x80484d9 <main+19>:    movl   $0x0,0xffffff98(%ebp)
^^^^^^^^^

Now there are eight:

(gdb) disassemble main     
Dump of assembler code for function main:
0x080484c6 <main+0>:    push   %ebp
0x080484c7 <main+1>:    mov    %esp,%ebp
0x080484c9 <main+3>:    sub    $0x238,%esp
0x080484cf <main+9>:    and    $0xfffffff0,%esp
0x080484d2 <main+12>:   mov    $0x0,%eax
0x080484d7 <main+17>:   sub    %eax,%esp
0x080484d9 <main+19>:   movl   $0x0,0xffffff98(%ebp)
^^^^^^^^^^
Thats fine, eight sits better in the binary world and it makes it
consistent with the output of "info break"

(gdb) break main
(gdb) info break
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x080484d9 in main at myprog.c:55
                            ^^^^^^^^^^
However "info frame" gives:

(gdb) info frame
Stack level 0, frame at 0xbffff730:
 eip = 0x80484d9 in main (myprog.c:55); saved eip 0x4006015a
       ^^^^^^^^^

Still seven digits. The human mind adjusts easily to such differences, but
front ends---or at least the one I'm writing for Emacs---don't.

So that I don't have to keep making piecemeal changes, I suggest that
memory addresses in "info frame" has the same format as disassemble
and "info break". I've not looked at the internals but maybe they could
all be printed with the same procedure call.

WDYT?

Nick

             reply	other threads:[~2005-05-25  3:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-25  3:18 Nick Roberts [this message]
2005-05-25  3:37 ` Daniel Jacobowitz
2005-05-25  3:51   ` Nick Roberts
2005-05-25 18:00     ` Eli Zaretskii
2005-05-25 21:10       ` Nick Roberts
2005-05-25 21:28         ` Daniel Jacobowitz
2005-05-25 23:11           ` Nick Roberts
2005-05-26  3:39             ` Eli Zaretskii
2005-05-26  3:46               ` Daniel Jacobowitz
2005-05-26  4:12               ` Nick Roberts
2005-05-25  4:12   ` Nick Roberts
2005-05-25  5:27 ` M.M. Kettenis
2005-05-25  5:48   ` Nick Roberts

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=17043.61074.262608.156551@farnswood.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb@sources.redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).