public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Consistent format for memory addresses
@ 2005-05-25  3:18 Nick Roberts
  2005-05-25  3:37 ` Daniel Jacobowitz
  2005-05-25  5:27 ` M.M. Kettenis
  0 siblings, 2 replies; 13+ messages in thread
From: Nick Roberts @ 2005-05-25  3:18 UTC (permalink / raw)
  To: gdb


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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-05-26  4:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-25  3:18 Consistent format for memory addresses Nick Roberts
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

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).