Re: [RFC][patch] Allow to disassemble line.

Joel Brobecker
2009-10-02T06:52:37Z

> 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