This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Switch out and in of tfind mode, when handling an event, in non-stop mode.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 11 Feb 2011 15:10:08 +0000
- Subject: Re: Switch out and in of tfind mode, when handling an event, in non-stop mode.
- References: <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