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

Joel Brobecker
2009-10-02T18:49:58Z

> Perhaps it is reasonable to get rid of the parameter, and just say that
> 'disas/l' always disassembles current line, [...]

Not necessarily. Perhaps we could look at the /l as a qualifier which
allows the user to specify that he's not going to provide a range, or
a start address, but rather one address that's part of a line. GDB
is to understand this as a request to disassemble the block of
instruction corresponding to the line corresponding to that address.

When looking at it this way, adding support for "foo.c:22" becomes
orthogonal to the introduction of the /l modifier. For instance,
you could do "disass /l" which, without argument, would access
the default value which conceptually is the $pc of the currently
selected frame.

We can also independently add FILE:LINE as a valid location expression
and make it work regardless of whether the /l modifier is used or not.

What I propose we do, for now, is not worry too much if the line of code
is split in multiple instruction blocks. Let's just print the first one,
for instance. There is no reason why we cannot deal with that later if
needed.

--
Joel