From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1895 invoked by alias); 9 Jul 2009 23:59:43 -0000 Received: (qmail 1887 invoked by uid 22791); 9 Jul 2009 23:59:42 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Jul 2009 23:59:37 +0000 Received: from wpaz33.hot.corp.google.com (wpaz33.hot.corp.google.com [172.24.198.97]) by smtp-out.google.com with ESMTP id n69NxY9c014505 for ; Thu, 9 Jul 2009 16:59:35 -0700 Received: from ewy5 (ewy5.prod.google.com [10.241.103.5]) by wpaz33.hot.corp.google.com with ESMTP id n69NxW83003841 for ; Thu, 9 Jul 2009 16:59:32 -0700 Received: by ewy5 with SMTP id 5so645470ewy.30 for ; Thu, 09 Jul 2009 16:59:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.3.65 with SMTP id 43mr389627weg.149.1247183970433; Thu, 09 Jul 2009 16:59:30 -0700 (PDT) In-Reply-To: <20090708205140.GA2926@caradoc.them.org> References: <7e6c8d660907081308r13bff580rdcf4822c77df8403@mail.gmail.com> <200907082146.40513.pedro@codesourcery.com> <20090708205140.GA2926@caradoc.them.org> Date: Fri, 10 Jul 2009 08:45:00 -0000 Message-ID: <7e6c8d660907091659l7db08484xf3aa6bb3f33f1a5e@mail.gmail.com> Subject: Re: [RFA] Use data cache for stack accesses From: Jacob Potter To: Pedro Alves , gdb-patches@sourceware.org, Jacob Potter Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00300.txt.bz2 Adding to struct inferior makes sense to me. Would we then just call current_inferior() in memory_xfer_partial()? 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_partial. > > 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 >