From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27268 invoked by alias); 25 May 2005 03:18:29 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 27257 invoked by uid 22791); 25 May 2005 03:18:23 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 25 May 2005 03:18:23 +0000 Received: from farnswood.snap.net.nz (p122-tnt2.snap.net.nz [202.124.108.122]) by viper.snap.net.nz (Postfix) with ESMTP id 40D2A537452 for ; Wed, 25 May 2005 15:18:19 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id EB15162A99; Wed, 25 May 2005 04:18:42 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17043.61074.262608.156551@farnswood.snap.net.nz> Date: Wed, 25 May 2005 03:18:00 -0000 To: gdb@sources.redhat.com Subject: Consistent format for memory addresses X-SW-Source: 2005-05/txt/msg00307.txt.bz2 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
: push %ebp 0x80484c7 : mov %esp,%ebp 0x80484c9 : sub $0x238,%esp 0x80484cf : and $0xfffffff0,%esp 0x80484d2 : mov $0x0,%eax 0x80484d9 : movl $0x0,0xffffff98(%ebp) ^^^^^^^^^ Now there are eight: (gdb) disassemble main Dump of assembler code for function main: 0x080484c6 : push %ebp 0x080484c7 : mov %esp,%ebp 0x080484c9 : sub $0x238,%esp 0x080484cf : and $0xfffffff0,%esp 0x080484d2 : mov $0x0,%eax 0x080484d7 : sub %eax,%esp 0x080484d9 : 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