[RFC,06/15] Add possibility to restart trace after tfind.
Commit Message
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(-)
Comments
On 10/14/2015 12:14 PM, henrik.wallin@windriver.com wrote:
> 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.
What would happen?
> This patch will add a question if the user wants to
> drop all collected data and start a new session.
Testcase.
Thanks,
Pedro Alves
@@ -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);
}