This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Use data cache for stack accesses
- From: Doug Evans <dje at google dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Jacob Potter <jdpotter at google dot com>
- Date: Thu, 20 Aug 2009 23:00:38 -0700
- Subject: Re: [RFA] Use data cache for stack accesses
- References: <7e6c8d660907081308r13bff580rdcf4822c77df8403@mail.gmail.com> <200907082146.40513.pedro@codesourcery.com>
On Wed, Jul 8, 2009 at 1:46 PM, Pedro Alves<pedro@codesourcery.com> wrote:
> On Wednesday 08 July 2009 21:08:00, Jacob Potter write:
>> --- a/gdb/thread.c
>> +++ b/gdb/thread.c
>> @@ -848,6 +848,9 @@ switch_to_thread (ptid_t ptid)
>> ? ?if (ptid_equal (ptid, inferior_ptid))
>> ? ? ?return;
>>
>> + ?if (ptid_get_pid (ptid) != ptid_get_pid (inferior_ptid))
>> + ? ?dcache_invalidate (target_dcache);
>> +
>
> I'm not sure this would be 100% multi-address space safe.
>
> Do we not have places where we switch inferior_ptid temporarily
> before calling reading memory, with save_inferior_ptid, without
> going through the high level switch_to_thread ?
Yeah.
> What if we do this within dcache itself, similarly
> to get_thread_regcache? ?That would be probably in [dcache_xfer_partial].
It seems that given that we can temporarily change inferiors without
giving subsystems notice of the change, and given vfork, then we need
to have intelligence in dcache to handle this (and then it's not clear
if we should keep one dcache per inferior).
How about having memory_xfer_partial notify dcache of every
write/read, and then dcache could keep just one copy of the cache and
flush it appropriately?