From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17906 invoked by alias); 10 Jul 2009 09:33:56 -0000 Received: (qmail 17866 invoked by uid 22791); 10 Jul 2009 09:33:35 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 10 Jul 2009 09:33:29 +0000 Received: (qmail 15128 invoked from network); 10 Jul 2009 09:33:28 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 Jul 2009 09:33:28 -0000 From: Pedro Alves To: Jacob Potter Subject: Re: [RFA] Use data cache for stack accesses Date: Fri, 10 Jul 2009 14:19:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org References: <7e6c8d660907081308r13bff580rdcf4822c77df8403@mail.gmail.com> <20090708205140.GA2926@caradoc.them.org> <7e6c8d660907091659l7db08484xf3aa6bb3f33f1a5e@mail.gmail.com> In-Reply-To: <7e6c8d660907091659l7db08484xf3aa6bb3f33f1a5e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200907101033.29377.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-07/txt/msg00304.txt.bz2 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). >=20 > On Wed, Jul 8, 2009 at 1:51 PM, Daniel Jacobowitz 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) > >> > =A0 =A0if (ptid_equal (ptid, inferior_ptid)) > >> > =A0 =A0 =A0return; > >> > > >> > + =A0if (ptid_get_pid (ptid) !=3D ptid_get_pid (inferior_ptid)) > >> > + =A0 =A0dcache_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? =A0That would be probably in memory_xfer_parti= al. > > > > Or could we store a dcache per-inferior? =A0Jacob's right - I thought > > there was an 'inferior_data' to store arbitrary data per-inferior, > > but there isn't. =A0I 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 > > >=20 --=20 Pedro Alves