diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 419765b..1ff6114 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -2354,6 +2354,8 @@ cmd_qtinit (char *packet) /* Make sure we don't try to read from a trace frame. */ current_traceframe = -1; + stop_tracing (); + trace_debug ("Initializing the trace"); clear_installed_tracepoints (); diff --git a/gdb/testsuite/gdb.trace/status-stop.exp b/gdb/testsuite/gdb.trace/status-stop.exp index bca03d2..33c1eb9 100644 --- a/gdb/testsuite/gdb.trace/status-stop.exp +++ b/gdb/testsuite/gdb.trace/status-stop.exp @@ -66,6 +66,7 @@ proc test_tstart_tstop_tstart { } { proc test_tstart_tstart { } { with_test_prefix "tstart_tstart" { + global gdb_prompt global executable global hex @@ -79,9 +80,13 @@ proc test_tstart_tstart { } { gdb_test "trace func1" "Tracepoint \[0-9\] at $hex: file.*" gdb_test_no_output "tstart" - gdb_test "tstart" "" "tstart again" \ - "A trace is running already. Start a new run\\? \\(y or n\\) " \ - "y" + set test "tstart again" + gdb_test_multiple "tstart" $test { + -re "A trace is running already. Start a new run.*y or n.*" { + # Send 'y' and make sure that we don't get any error. + gdb_test_no_output "y" $test + } + } } }