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: Yao Qi <yao at codesourcery dot com>
- Cc: Doug Evans <dje at google dot com>, "Abid, Hafiz" <Hafiz_Abid at mentor dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "Mirza, Taimoor" <Taimoor_Mirza at mentor dot com>
- Date: Wed, 16 Oct 2013 13:08:24 +0100
- Subject: Re: [patch] Disassembly improvements
- Authentication-results: sourceware.org; auth=none
- References: <EB3B29AD43CA924DA27099BC85192376E0705106 at EU-MBX-03 dot mgc dot mentorg dot com> <CADPb22RShPCFWpZhgfv6-ZDtSA=6PK+qwVaetth4tKM1LJLnjA at mail dot gmail dot com> <525C02E5 dot 2060601 at redhat dot com> <21085 dot 59640 dot 697075 dot 435874 at ruffy dot mtv dot corp dot google dot com> <525E4596 dot 70503 at codesourcery dot com>
On 10/16/2013 08:51 AM, Yao Qi wrote:
> On 10/16/2013 09:16 AM, Doug Evans wrote:
>> > If I were to try one, I think it would be along the lines of
>> > a new TARGET_OBJECT_DISASM_MEMORY, and somehow pass more info down
>> > the target_xfer interface so that the the core memory reading code
>> > handles the caching. Probably, that'd be done with a new pair of
>> > 'begin/end code caching' functions that would be called at the
>> > appropriate places. The new code in dis_asm_read_memory would
>> > then be pushed to target.c, close to where stack cache is handled.
>>
>> How hard would it be to do that now?
>
> AFAICS, it is not hard. We've already had TARGET_OBJECT_STACK_MEMORY,
> so it is straightforward to add TARGET_OBJECT_CODE_MEMORY, and disas and
> skip_prologue can use it.
Are you going to give it a try? That'd be great.
Yeah, adding the new target object part is straightforward. What
may not be, is either adjusting the dcache.c to the specifics of
disassembly, and range limiting, and making sure the cache is bounded
correctly, and flushed at the appropriate times. It's one of those
"must try it to tell" things, I think.
--
Pedro Alves