This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Disassembly improvements
- From: Pedro Alves <palves at redhat dot com>
- To: "Abid, Hafiz" <Hafiz_Abid at mentor dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "Mirza, Taimoor" <Taimoor_Mirza at mentor dot com>
- Date: Thu, 10 Oct 2013 15:52:11 +0100
- Subject: Re: [patch] Disassembly improvements
- Authentication-results: sourceware.org; auth=none
- References: <EB3B29AD43CA924DA27099BC85192376E0705106 at EU-MBX-03 dot mgc dot mentorg dot com> <5256ACED dot 7040402 at redhat dot com> <EB3B29AD43CA924DA27099BC85192376E0705237 at EU-MBX-03 dot mgc dot mentorg dot com>
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