--- remote.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) --- a/remote.c +++ b/remote.c @@ -3203,6 +3203,7 @@ remote_start_remote (int from_tty, struc struct remote_state *rs = get_remote_state (); struct packet_config *noack_config; char *wait_status = NULL; + struct trace_status *ts = current_trace_status (); immediate_quit++; /* Allow user to interrupt it. */ @@ -3212,6 +3213,9 @@ remote_start_remote (int from_tty, struc /* Ack any packet which the remote side has already sent. */ serial_write (remote_desc, "+", 1); + /* Clear current status of trace. */ + ts->running_known = 0; + /* The first packet we send to the target is the optional "supported packets" request. If the target can answer this, it will tell us which later probes to skip. */ @@ -10122,9 +10126,14 @@ static int remote_can_download_tracepoint (void) { struct trace_status *ts = current_trace_status (); - int status = remote_get_trace_status (ts); + int status; - if (status == -1 || !ts->running_known || !ts->running) + if (!ts->running_known) + return 0; + + status = remote_get_trace_status (ts); + + if (status == -1 || !ts->running) return 0; /* If we are in a tracing experiment, but remote stub doesn't support