From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31635 invoked by alias); 19 Oct 2009 18:49:00 -0000 Received: (qmail 31623 invoked by uid 22791); 19 Oct 2009 18:49:00 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Oct 2009 18:48:55 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 58D21105BB; Mon, 19 Oct 2009 18:48:54 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 2F48010576; Mon, 19 Oct 2009 18:48:54 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MzxHp-000581-He; Mon, 19 Oct 2009 14:48:53 -0400 Date: Mon, 19 Oct 2009 18:49:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: tromey@redhat.com, gdb-patches@sourceware.org Subject: Re: [RFC][patch] Allow to disassemble line. Message-ID: <20091019184853.GA18564@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , tromey@redhat.com, gdb-patches@sourceware.org References: <20091002004954.8966C76B2B@ppluzhnikov.mtv.corp.google.com> <8ac60eac0910080916i5a2eb49an5f21f3b5c7fb96ef@mail.gmail.com> <20091008162350.GA8625@caradoc.them.org> <8ac60eac0910080952p46f15693x6ed339473db0139d@mail.gmail.com> <8ac60eac0910161607k55fee22cs379c5b7635d7b6a@mail.gmail.com> <8ac60eac0910191109v62794c33g6712090912b5c11f@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0910191109v62794c33g6712090912b5c11f@mail.gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00440.txt.bz2 On Mon, Oct 19, 2009 at 11:09:44AM -0700, Paul Pluzhnikov wrote: > I've also changed the "current PC marker" from "* " to "=> " (as Eli > suggested), so the output looks like this: > > (top) disas > Dump of assembler code for function gdb_main: > 0x0000000000454c9e : push %rbp > 0x0000000000454c9f : mov %rsp,%rbp > 0x0000000000454ca2 : sub $0x10,%rsp > 0x0000000000454ca6 : mov %rdi,-0x8(%rbp) > => 0x0000000000454caa : mov -0x8(%rbp),%rax > 0x0000000000454cae : mov 0x10(%rax),%eax > 0x0000000000454cb1 : mov %eax,0x678475(%rip) # > 0xacd12c For whatever it's worth, I miss the extra screen real estate stolen by the enlarged prompt (or even the narrower prompt). I use a wider than average terminal and most of the times I use disassemble it still runs off the right and wraps unreadably. It's fine in examples because they have names like "gdb_main" or "bar"... We've got this layout here with nicely aligned columns but tons of whitespace. In a halfway modern world we could do this with color. Or bold the address of the current instruction. This would be a real interface departure for GDB so I'm curious what others think of it. (Yes, I'm thinking of Tufte, why do you ask?) Another possibility would be to factor out the name of the function. Something like this: (top) disas Dump of assembler code for function gdb_main: 0x0000000000454c9e (+0): push %rbp 0x0000000000454c9f (+1): mov %rsp,%rbp 0x0000000000454ca2 (+4): sub $0x10,%rsp 0x0000000000454ca6 (+8): mov %rdi,-0x8(%rbp) => 0x0000000000454caa (+12): mov -0x8(%rbp),%rax 0x0000000000454cae (+16): mov 0x10(%rax),%eax Or for x, current version: (gdb) x/2i main 0x44cce0
: sub $0x28,%rsp 0x44cce4 : movq $0x0,(%rsp) (gdb) 0x44ccec : mov %edi,(%rsp) 0x44ccef : mov %rsp,%rdi After: (gdb) x/2i main Dump of assembler code for function main: 0x44cce0 (+0): sub $0x28,%rsp 0x44cce4 (+4): movq $0x0,(%rsp) (gdb) 0x44ccec (+12): mov %edi,(%rsp) 0x44ccef (+15): mov %rsp,%rdi ... (gdb) 0x44cd1a (+58): retq 0x44cd1b: nop ... (gdb) 0x44cd1f: nop Dump of assembler code for function gdb_main: 0x44cd20 (+0): sub $0x8,%rsp Anyway, I just made that all up. I'm not asking for anyone to work on it but I'd like to know what ways we have to reclaim some of this space before we eat up more of it. I do observe that disassemble prints leading zeros and examine strips them. -- Daniel Jacobowitz CodeSourcery