This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][patch] Allow to disassemble line.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 1 Oct 2009 23:52:26 -0700
- Subject: Re: [RFC][patch] Allow to disassemble line.
- References: <20091002004954.8966C76B2B@ppluzhnikov.mtv.corp.google.com>
> Attached patch makes it so 'disas/l' will disassemble current line, and
> 'disas/l foo.c:22' will disassemble line 22 of foo.c
Without looking at the implementation itself for now, I have to say that
I have been missing this feature very badly.
Questions:
1. What should we do if there are more than one match for the given SAL?
Probably, we want to display a multiple-choice menu, and force the
user to select one and only one choice.
Eg: disass /l foo.c:22
Multiple matches for foo.c:22
[0] cancel
[1] foo at foo.c:22
[2] bar at foo.c:22
>
This can happen I think with templates (called generics in Ada),
and probably inlining.
2. A little trickier: How do we want to handle the case where a line
of code is split in more than one block of instructions. This happens
really often when debugging optimized code.
Right now, the easy solution is to only disassemble the first
block. It'd be nice to have them all, though. Perhaps printing
the instructions for each block one after the other, with something
like a little sign in between indicating the next instruction is
part of another block?
0x... <fun_name+nn> bla bla bla
0x... <fun_name+mm> bla bla bla
[...]
0x... <fun_name+oo> bla bla bla
Anyway, I really like this new feature.
--
Joel