From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4922 invoked by alias); 11 Feb 2011 15:10:39 -0000 Received: (qmail 4911 invoked by uid 22791); 11 Feb 2011 15:10:38 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Feb 2011 15:10:22 +0000 Received: (qmail 22526 invoked from network); 11 Feb 2011 15:10:20 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Feb 2011 15:10:20 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Switch out and in of tfind mode, when handling an event, in non-stop mode. Date: Fri, 11 Feb 2011 15:10:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-25-generic; KDE/4.5.1; x86_64; ; ) References: <201002240108.23691.pedro@codesourcery.com> In-Reply-To: <201002240108.23691.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201102111510.08912.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: 2011-02/txt/msg00210.txt.bz2 Back in : > 2010-02-24 Pedro Alves > Stan Shebs > > gdb/ ... > * infrun.c: Include tracepoint.h. > (fetch_inferior_event): Switch out and in of tfind mode. > Index: src/gdb/infrun.c > =================================================================== > --- src.orig/gdb/infrun.c 2010-02-17 01:22:10.000000000 +0000 > +++ src/gdb/infrun.c 2010-02-24 00:55:37.000000000 +0000 ... > @@ -1761,6 +1762,16 @@ proceed (CORE_ADDR addr, enum target_sig How embarassing! This hunk should have been applied on `fetch_inferior_event', but I somehow managed to merge it to `proceed'... Fortunately or not, it's dead code here because you can't resume while inspecting traceframes. But this also means that I hadn't actually fixed the bug I claimed to have fixed... I've applied to patch below to both mainline and the 7.2 branch, in order to put things as they were meant to be in the first place. > "infrun: proceed (addr=%s, signal=%d, step=%d)\n", > paddress (gdbarch, addr), siggnal, step); > > + /* We're handling a live event, so make sure we're doing live > + debugging. If we're looking at traceframes while the target is > + running, we're going to need to get back to that mode after > + handling the event. */ > + if (non_stop) > + { > + make_cleanup_restore_current_traceframe (); > + set_traceframe_number (-1); > + } > + > if (non_stop) > /* In non-stop, each thread is handled individually. The context > must already be set to the right thread here. */ Pedro Alves 2011-02-11 Pedro Alves * infrun.c (proceed): Move switching out and in of tfind mode from here ... (fetch_inferior_event): ... to here. --- gdb/infrun.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) Index: src/gdb/infrun.c =================================================================== --- src.orig/gdb/infrun.c 2011-01-13 15:07:24.000000000 +0000 +++ src/gdb/infrun.c 2011-02-11 13:55:40.447503998 +0000 @@ -1994,16 +1994,6 @@ proceed (CORE_ADDR addr, enum target_sig "infrun: proceed (addr=%s, signal=%d, step=%d)\n", paddress (gdbarch, addr), siggnal, step); - /* We're handling a live event, so make sure we're doing live - debugging. If we're looking at traceframes while the target is - running, we're going to need to get back to that mode after - handling the event. */ - if (non_stop) - { - make_cleanup_restore_current_traceframe (); - set_traceframe_number (-1); - } - if (non_stop) /* In non-stop, each thread is handled individually. The context must already be set to the right thread here. */ @@ -2634,6 +2624,16 @@ fetch_inferior_event (void *client_data) /* We'll update this if & when we switch to a new thread. */ previous_inferior_ptid = inferior_ptid; + /* We're handling a live event, so make sure we're doing live + debugging. If we're looking at traceframes while the target is + running, we're going to need to get back to that mode after + handling the event. */ + if (non_stop) + { + make_cleanup_restore_current_traceframe (); + set_traceframe_number (-1); + } + if (non_stop) /* In non-stop mode, the user/frontend should not notice a thread switch due to internal events. Make sure we reverse to the