This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix tracepoints in extended-remote mode regression (Re: Fix error when gdb connect to a stub that tracepoint is running[1/2] Add a flag initialized to struct trace_status)
- From: Pedro Alves <palves at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Hui Zhu <hui_zhu at mentor dot com>, Yao Qi <Yao_Qi at mentor dot com>
- Date: Tue, 20 Mar 2012 18:50:25 +0000
- Subject: Fix tracepoints in extended-remote mode regression (Re: Fix error when gdb connect to a stub that tracepoint is running[1/2] Add a flag initialized to struct trace_status)
- References: <4F4F8BE2.7030503@mentor.com> <4F4FB2F9.80200@redhat.com> <4F4FC4AD.3020501@redhat.com>
On 03/01/2012 06:49 PM, Pedro Alves wrote:
>
> 2012-03-01 Pedro Alves <palves@redhat.com>
> Hui Zhu <hui_zhu@mentor.com>
> Yao Qi <yao@codesourcery.com>
>
> * remote.c (struct remote_state): New field `starting_up'.
> (remote_start_remote): Set and clear it.
> (remote_can_download_tracepoint): If starting up, return false.
This misses clearing `starting_up' on early return paths of remote_start_remote,
an so remote_can_download_tracepoint always return false in extended-remote mode.
With the extended-remote board, but not with the regular remote board:
Running ../../../src/gdb/testsuite/gdb.trace/change-loc.exp ...
FAIL: gdb.trace/change-loc.exp: 1 trace: tfind frame 0
FAIL: gdb.trace/change-loc.exp: 2 trace: tfind frame 2
FAIL: gdb.trace/change-loc.exp: 1 ftrace: running to main in runto
FAIL: gdb.trace/change-loc.exp: 1 ftrace: Can't run to main
FAIL: gdb.trace/change-loc.exp: 2 ftrace: run to main (the program exited)
FAIL: gdb.trace/change-loc.exp: 2 ftrace: tstart
...
(snip yet more fails)
This fixes it. Applied on mainline and 7.4.
2012-03-20 Pedro Alves <palves@redhat.com>
* remote.c (remote_start_remote): Clear `rs->starting_up' on early
returns.
---
gdb/remote.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Index: src/gdb/remote.c
===================================================================
--- src.orig/gdb/remote.c
+++ src/gdb/remote.c
@@ -3268,6 +3268,7 @@ remote_start_remote (int from_tty, struc
/* We're connected, but not running. Drop out before we
call start_remote. */
+ rs->starting_up = 0;
return;
}
else
@@ -3374,6 +3375,7 @@ remote_start_remote (int from_tty, struc
/* We're connected, but not running. Drop out before we
call start_remote. */
+ rs->starting_up = 0;
return;
}