Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
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	[thread overview]
Message-ID: <201102111510.08912.pedro@codesourcery.com> (raw)
In-Reply-To: <201002240108.23691.pedro@codesourcery.com>

Back in
<http://sourceware.org/ml/gdb-patches/2010-02/msg00582.html>:

> 2010-02-24  Pedro Alves  <pedro@codesourcery.com>
>             Stan Shebs  <stan@codesourcery.com>
> 
>         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  <pedro@codesourcery.com>

	* 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


      parent reply	other threads:[~2011-02-11 15:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24  1:08 Pedro Alves
2010-02-24  7:33 ` Stan Shebs
2010-02-24 15:59   ` Pedro Alves
2010-02-24 21:44     ` Pedro Alves
2011-02-11 15:10 ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102111510.08912.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox