From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10973 invoked by alias); 5 Dec 2013 01:21:43 -0000 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 Received: (qmail 10955 invoked by uid 89); 5 Dec 2013 01:21:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.8 required=5.0 tests=AWL,BAYES_50,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Dec 2013 01:21:41 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VoNd5-0007lD-Tv from Yao_Qi@mentor.com ; Wed, 04 Dec 2013 17:21:23 -0800 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 4 Dec 2013 17:21:23 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Wed, 4 Dec 2013 17:21:23 -0800 Message-ID: <529FD4B9.10008@codesourcery.com> Date: Thu, 05 Dec 2013 01:21:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Mark Kettenis , Subject: Re: [PATCH 2/3] skip_prolgoue (amd64) References: <1385735051-27558-1-git-send-email-yao@codesourcery.com> <1385735051-27558-3-git-send-email-yao@codesourcery.com> <201311291436.rATEaZ5Z030292@glazunov.sibelius.xs4all.nl> <201311291605.rATG5XVb030184@glazunov.sibelius.xs4all.nl> <52994E79.4000004@codesourcery.com> <5299B9D0.2020304@redhat.com> <529C37A2.9000207@codesourcery.com> <529E9462.9010001@codesourcery.com> <529F1B1F.2040606@redhat.com> In-Reply-To: <529F1B1F.2040606@redhat.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00163.txt.bz2 On 12/04/2013 08:07 PM, Pedro Alves wrote: > It can still help for the duration of the command, or for the > duration of the event handling. GDB might end up reading the > same locations more than once while doing either. Also, the > overfetching can still help anyway. E.g., in the prologue > analyzers while handling each event. While handling an event, if another thread is still running, we still can't use cache. > > Actually "non-stop", vs "all-stop" here isn't the ideal > predicate. The real predicate is "is any thread running". > "non-stop" is just being currently used in > prepare_execute_command as proxy for that, just because > that was the easiest. > Beside the predicate "is any thread running", another is "no thread is resumed since last flushing". Cache should be flushed when either is true. > On 12/04/2013 02:33 AM, Yao Qi wrote: > >> >@@ -2806,6 +2807,16 @@ fetch_inferior_event (void *client_data) >> > >> > overlay_cache_invalid = 1; >> > >> >+ if (non_stop) >> >+ { >> >+ /* In non-stop mode, one thread stops and caches the contents of >> >+ stack or code, while other running threads may change the >> >+ code (through JIT) or stack. The target cache can get stale >> >+ without us being able to detect it. Flush target cache >> >+ before handling each event. */ >> >+ target_dcache_invalidate (); >> >+ } > I don't actually think this should be gated on non-stop. It Right, "non-stop" is not a proper condition here. > should be unconditional. I mentioned before that it'd be most > visible with non-stop, but that doesn't imply it's not > visible with all-stop. If we're seeing or going to wait for > a target event, it's because the target was running, > irrespective of all-stop/non-stop. I really think we That is true, but once we got a target event, target(or thread in the target) may not stop. It is still unsafe to use cache. -- Yao (齐尧)