From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7583 invoked by alias); 21 Sep 2011 15:44:35 -0000 Received: (qmail 7574 invoked by uid 22791); 21 Sep 2011 15:44:33 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Sep 2011 15:44:20 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R6OyB-00014E-FB from pedro_alves@mentor.com ; Wed, 21 Sep 2011 08:44:19 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Sep 2011 16:44:15 +0100 From: Pedro Alves To: Yao Qi Subject: Re: Displaced stepping not always working as expected Date: Wed, 21 Sep 2011 15:44:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: gdb@sourceware.org, Marc Khouzam References: <201109211123.11622.pedro@codesourcery.com> <4E7A051A.3050801@codesourcery.com> In-Reply-To: <4E7A051A.3050801@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201109211644.14128.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00082.txt.bz2 On Wednesday 21 September 2011 16:39:06, Yao Qi wrote: > On 09/21/2011 06:23 PM, Pedro Alves wrote: > > On Wednesday 21 September 2011 07:08:43, Yao Qi wrote: > >> The line of log looks strange to me. Why LWP 763 switch to itself? > > > > This is non-stop mode, and fetch_inferior_event always prints the > > "context switch": > > > > if (non_stop > > && ecs->ws.kind != TARGET_WAITKIND_IGNORE > > && ecs->ws.kind != TARGET_WAITKIND_EXITED > > && ecs->ws.kind != TARGET_WAITKIND_SIGNALLED) > > /* In non-stop mode, each thread is handled individually. Switch > > early, so the global state is set correctly for this > > thread. */ > > context_switch (ecs->ptid); > > > > Pedro, > I don't quite understand this piece of code and the comments here, but I > think that debug log "context switch from Thread A to Thread A" is not > useful, if not confusing. I guess you'd have to back to a time where context_switch really did more than just switching the thread. It used to swap a _bunch_ of globals with the copies in the thread structure. It was horrible. > How about this patch? Sure. Okay. -- Pedro Alves