Re: [patch v4 01/13] disas: add precise instructions flag

Pedro Alves
2012-11-27T17:33:44Z

On 11/27/2012 05:26 PM, Metzger, Markus T wrote:

>> From: Pedro Alves [mailto:palves@redhat.com]

>>> the addresses that
>>> are being disassembled may not exactly match the specified range.
>>
>> Is this another symptom of the issue that "disasm /m" sorts by
>> line number, rather than the much more reasonable sort-by-address,
>> which is IIRC what objdump does too?
>
> Yes. I didn't want to go that far.
>
> The patch is incomplete. It merely truncates the first and last block that gdb prints. If you wanted to change the behavior of "disasm /m", anyway, we can discard this patch. Sort-by-address is exactly what I'm looking for. Is somebody already working on this?

I've never heard of anyone who actually likes the current behavior. On the
contrary, I've heard several of the gdb developers wanting it the other way.
But I'm not aware of anyone working on it. I'm not sure how hard is it
to implement. Both gdb and objdump use libopcodes to disassemble, so
one would think that it's quite doable. I think a wrinkle may be that
the TUI uses the same code and the current sorting may (or not) make sense there
I think the /m flag was just implemented as reusing the TUI code to begin with.

--
Pedro Alves