2013-06-25 Yao Qi <yao@codesourcery.com>
+
+ * remote.c (remote_start_remote): Move code to upload tsv
+ earlier.
+
+2013-06-25 Yao Qi <yao@codesourcery.com>
Hui Zhu <hui@codesourcery.com>
Pedro Alves <palves@redhat.com>
+2013-06-25 Yao Qi <yao@codesourcery.com>
+
+ * gdbint.texinfo (Testsuite): Document 'gdb,predefined_tsv'.
+
2013-06-24 Tom Tromey <tromey@redhat.com>
* Makefile.in (POD2MAN1, POD2MAN5): Use version.subst.
@c NEED DOCUMENT.
@item use_gdb_stub
The tests are running with gdb stub.
+@item gdb,predefined_tsv
+The predefined trace state variables the board has.
+
@end table
@node Hints
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);
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);
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.
+
+2013-06-25 Yao Qi <yao@codesourcery.com>
Hui Zhu <hui@codesourcery.com>
Pedro Alves <palves@redhat.com>
}
return [eval [list standard_file $dest $op] $args]
}
+
+# The predefined TSVs in GDBserver.
+set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
}
return [eval [list standard_file $dest $op] $args]
}
+
+# The predefined TSVs in GDBserver.
+set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
}
return [eval [list standard_file $dest $op] $args]
}
+
+# The predefined TSVs in GDBserver.
+set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
# Test attaching to already-running programs using extended-remote.
load_lib gdbserver-support.exp
+load_lib trace-support.exp
standard_testfile
gdb_test "attach $testpid" \
"Attaching to program: .*, process $testpid.*(in|at).*" \
"attach to remote program 1"
+
+if { [gdb_target_supports_trace] } then {
+ # Test predefined TSVs are uploaded.
+ gdb_test_sequence "info tvariables" "check uploaded tsv" {
+ "\[\r\n\]+Name\[\t \]+Initial\[\t \]+Current"
+ "\[\r\n\]+\\\$trace_timestamp 0"
+ }
+}
+
gdb_test "backtrace" ".*main.*" "backtrace 1"
gdb_test "detach" "Detaching from program.*process.*"
check_tsv "ctf"
}
}
+
+# Restart.
+clean_restart ${binfile}
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return
+}
+
+# If there are predefined TSVs, test these predefined TSVs are correctly
+# uploaded.
+if [target_info exists gdb,predefined_tsv] {
+ set tsv [target_info gdb,predefined_tsv]
+
+ # Test predefined TSVs are uploaded.
+ gdb_test "info tvariables" ".*${tsv}.*" "predefined tsvs are uploaded"
+} else {
+ # Otherwise (the predefined TSVs are not defined in the board file),
+ # test there is no TSVs in GDB.
+ gdb_test "info tvariables" "No trace state variables\." \
+ "no predefined tsvs"
+}