This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFC][PATCH 06/15] Add possibility to restart trace after tfind.
- From: henrik dot wallin at windriver dot com
- To: gdb-patches at sourceware dot org
- Date: Wed, 14 Oct 2015 13:14:24 +0200
- Subject: [RFC][PATCH 06/15] Add possibility to restart trace after tfind.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1444820235 dot git dot henrik dot wallin at windriver dot com>
- References: <cover dot 1444820235 dot git dot henrik dot wallin at windriver dot com>
From: Par Olsson <par.olsson@windriver.com>
After starting examine the collected trace data
with tfind it was not possible to re-start a trace session.
This patch will add a question if the user wants to
drop all collected data and start a new session.
gdb/ChangeLog:
* tracepoint.c : Initiate traceframe_number.
(trace_start_command): Add interactive question if
user wants to clear and restart a trace session when issuing a
tstart while in progress examining trace data.
Signed-off-by: Par Olsson <par.olsson@windriver.com>
Signed-off-by: Henrik Wallin <henrik.wallin@windriver.com>
---
gdb/tracepoint.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 6ca66e7c8d18..4aad1d6a4197 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -123,7 +123,7 @@ static VEC(tsv_s) *tvariables;
static int next_tsv_number = 1;
/* Number of last traceframe collected. */
-static int traceframe_number;
+static int traceframe_number = -1;
/* Tracepoint for last traceframe collected. */
static int tracepoint_number;
@@ -1914,6 +1914,18 @@ trace_start_command (char *args, int from_tty)
&& !query (_("A trace is running already. Start a new run? ")))
error (_("New trace run not started."));
}
+ if (traceframe_number >= 0)
+ {
+ if (from_tty
+ && !query (_("Currently examining trace data. "
+ "Start a new run? ")))
+ error (_("New trace run not started."));
+ /* Reset our local state. */
+ set_traceframe_num (-1);
+ set_tracepoint_num (-1);
+ set_traceframe_context (NULL);
+ clear_traceframe_info ();
+ }
start_tracing (args);
}
--
2.1.4