aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-06-25 13:01:28 +0000
committerYao Qi <yao@codesourcery.com>2013-06-25 13:01:28 +0000
commita0743c90c7c48938c0bd80fc3aa316e90ee26495 (patch)
treeb7b4c64341eb6f9ffedeb7b249d6b7a1a5f180bc /gdb/remote.c
parent9d6e6e84f73ef7c5410c097a23d5952a99684f5b (diff)
downloadgdb-a0743c90c7c48938c0bd80fc3aa316e90ee26495.zip
gdb-a0743c90c7c48938c0bd80fc3aa316e90ee26495.tar.gz
gdb-a0743c90c7c48938c0bd80fc3aa316e90ee26495.tar.bz2
Upload tsv earlier in remote_start_remote
In extended-remote, when GDB connects the target, but target is not running, the TSVs are not uploaded. When GDB attaches to a process, the TSVs are not uploaded either. However, GDBserver has some builtin or predefined TSV to upload, such as $trace_timestamp. This bug causes $trace_timestamp is never uploaded. gdb/ 2013-06-25 Yao Qi <yao@codesourcery.com> * remote.c (remote_start_remote): Move code to upload tsv earlier. gdb/testsuite/ 2013-06-25 Yao Qi <yao@codesourcery.com> * boards/native-extended-gdbserver.exp: Set board_info 'gdb,predefined_tsv'. * boards/native-gdbserver.exp: Likewise. * boards/native-stdio-gdbserver.exp: Likewise. * gdb.server/ext-attach.exp: Load trace-support.exp. Check uploaded TSVs if target supports tracing. * gdb.trace/tsv.exp: Check uploaded TSVs if target supports tracing and target has predefined tsv. gdb/doc/ 2013-06-25 Yao Qi <yao@codesourcery.com> * gdbint.texinfo (Testsuite): Document 'gdb,predefined_tsv'.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 080d048..7928f57 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -3452,6 +3452,17 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
error (_("Remote refused setting all-stop mode with: %s"), rs->buf);
}
+ /* Upload TSVs regardless of whether the target is running or not. The
+ remote stub, such as GDBserver, may have some predefined or builtin
+ TSVs, even if the target is not running. */
+ if (remote_get_trace_status (current_trace_status ()) != -1)
+ {
+ struct uploaded_tsv *uploaded_tsvs = NULL;
+
+ remote_upload_trace_state_variables (&uploaded_tsvs);
+ merge_uploaded_trace_state_variables (&uploaded_tsvs);
+ }
+
/* Check whether the target is running now. */
putpkt ("?");
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -3591,18 +3602,10 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
if (remote_get_trace_status (current_trace_status ()) != -1)
{
struct uploaded_tp *uploaded_tps = NULL;
- struct uploaded_tsv *uploaded_tsvs = NULL;
if (current_trace_status ()->running)
printf_filtered (_("Trace is already running on the target.\n"));
- /* Get trace state variables first, they may be checked when
- parsing uploaded commands. */
-
- remote_upload_trace_state_variables (&uploaded_tsvs);
-
- merge_uploaded_trace_state_variables (&uploaded_tsvs);
-
remote_upload_tracepoints (&uploaded_tps);
merge_uploaded_tracepoints (&uploaded_tps);