Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: tromey@redhat.com, gdb-patches@sourceware.org
Subject: Re: [RFC][patch] Allow to disassemble line.
Date: Mon, 19 Oct 2009 18:49:00 -0000	[thread overview]
Message-ID: <20091019184853.GA18564@caradoc.them.org> (raw)
In-Reply-To: <8ac60eac0910191109v62794c33g6712090912b5c11f@mail.gmail.com>

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 <gdb_main+0>:     push   %rbp
>    0x0000000000454c9f <gdb_main+1>:     mov    %rsp,%rbp
>    0x0000000000454ca2 <gdb_main+4>:     sub    $0x10,%rsp
>    0x0000000000454ca6 <gdb_main+8>:     mov    %rdi,-0x8(%rbp)
> => 0x0000000000454caa <gdb_main+12>:    mov    -0x8(%rbp),%rax
>    0x0000000000454cae <gdb_main+16>:    mov    0x10(%rax),%eax
>    0x0000000000454cb1 <gdb_main+19>:    mov    %eax,0x678475(%rip) #
> 0xacd12c <use_windows>

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 <main>:        sub    $0x28,%rsp
0x44cce4 <main+4>:      movq   $0x0,(%rsp)
(gdb) <enter>
0x44ccec <main+12>:     mov    %edi,(%rsp)
0x44ccef <main+15>:     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) <enter>
0x44ccec (+12):         mov    %edi,(%rsp)
0x44ccef (+15):         mov    %rsp,%rdi
...
(gdb) <enter>
0x44cd1a (+58):     retq
0x44cd1b:           nop
...
(gdb) <enter>
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


  parent reply	other threads:[~2009-10-19 18:49 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-02  0:50 Paul Pluzhnikov
2009-10-02  6:52 ` Joel Brobecker
2009-10-02 18:31   ` Paul Pluzhnikov
2009-10-02 18:49     ` Joel Brobecker
2009-10-02 15:17 ` Tom Tromey
2009-10-08 16:16 ` Paul Pluzhnikov
2009-10-08 16:23   ` Daniel Jacobowitz
2009-10-08 16:25     ` Joel Brobecker
2009-10-08 16:52     ` Paul Pluzhnikov
2009-10-08 17:29       ` Daniel Jacobowitz
2009-10-08 17:33         ` Joel Brobecker
2009-10-16 23:07       ` Paul Pluzhnikov
2009-10-16 23:11         ` Paul Pluzhnikov
2009-10-17  8:33           ` Eli Zaretskii
2009-10-17 15:50             ` Paul Pluzhnikov
2009-10-17 16:49               ` Eli Zaretskii
2009-10-17 17:08                 ` Paul Pluzhnikov
2009-10-17 19:55                   ` Eli Zaretskii
2009-10-19 17:47         ` Tom Tromey
2009-10-19 18:09           ` Paul Pluzhnikov
2009-10-19 18:20             ` Paul Pluzhnikov
2009-10-19 18:30             ` Tom Tromey
2009-10-21  0:22               ` Paul Pluzhnikov
2009-10-21  4:07                 ` Eli Zaretskii
2009-10-21 18:06                   ` Paul Pluzhnikov
2009-10-21 18:16                     ` Eli Zaretskii
2009-10-21 17:24                 ` Tom Tromey
2009-10-19 18:49             ` Daniel Jacobowitz [this message]
2009-10-19 19:40               ` Joel Brobecker
2009-10-19 19:56                 ` Daniel Jacobowitz
2009-10-19 20:03                   ` Tom Tromey
2009-10-19 20:10                     ` Joel Brobecker
2009-10-19 20:23                       ` Paul Pluzhnikov
2009-10-19 20:47                         ` Daniel Jacobowitz
2009-10-19 19:40               ` Eli Zaretskii
2009-10-19 19:55                 ` Daniel Jacobowitz
2009-10-20 16:04               ` Tom Tromey
2009-10-08 16:24   ` Joel Brobecker
2009-10-08 17:16     ` 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=20091019184853.GA18564@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.com \
    --cc=tromey@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