Re: [patch] Disassembly improvements

Pedro Alves
2013-10-10T14:52:18Z

On 10/10/2013 02:57 PM, Abid, Hafiz wrote:
>> >
>> > Hmm, this seems to miss making sure LEN doesn't read beyond the original
>> > requested memory range. It'd be good to add that.
> Changed to following line which should take care of this.
> unsigned int length = min (len, info->buffer_length);

But it seems to me that will just disable the optimization for
buffer line > 1.

LEN here I think will the disassembler considers to be the maximum
length of an instruction for the arquitecture it is disassembling.
We want to read _more_ than that from memory in one go, otherwise, we'll
not be buffering anything. What we do not want, is for that over
fetching to read beyond the range that was passed to gdb_disassembly.

I think we'll need to derive from "struct disassemble_info",
and add the original range to that new struct, or record that info
directly in "struct disassemble_info", which is in include/dis-asm.h.

--
Pedro Alves