This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Use data cache for stack accesses


On Friday 10 July 2009 00:59:30, Jacob Potter wrote:
> Adding to struct inferior makes sense to me. Would we then just call
> current_inferior() in memory_xfer_partial()?

You can't do that unconditionaly.  struct inferior's are mostly a
process_stratum and inferior control entity: it is an internal error to
call it when there's no current inferior (but note that it is still valid
to read memory from the executable).

> 
> On Wed, Jul 8, 2009 at 1:51 PM, Daniel Jacobowitz<drow@false.org> wrote:
> > On Wed, Jul 08, 2009 at 09:46:40PM +0100, Pedro Alves 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 ?
> >>
> >> What if we do this within dcache itself, similarly
> >> to get_thread_regcache? ?That would be probably in memory_xfer_partial.
> >
> > Or could we store a dcache per-inferior? ?Jacob's right - I thought
> > there was an 'inferior_data' to store arbitrary data per-inferior,
> > but there isn't. ?I don't like baking knowledge into other modules
> > of GDB that they can extract the PID and use it to key per-inferior
> > data.
> >
> > Or just add it to struct inferior?
> >
> > --
> > Daniel Jacobowitz
> > CodeSourcery
> >
> 



-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]