This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 4/5] tsv.exp: Test TSV from CTF


It is a test that GDB reads TSV from CTF trace data, which should be
exactly the same as reading data from the remote target and tfile trace
data.

gdb/testsuite:

2013-03-07  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/tsv.exp: Save trace frame to CTF.  If GDB supports,
	read CTF data by target ctf and call check_tsv.
---
 gdb/testsuite/gdb.trace/tsv.exp |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index 97dcaba..229817a 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -145,6 +145,9 @@ gdb_test_no_output "tstop" ""
 # Save trace frames to tfile.
 gdb_test "tsave ${testfile}.tf" \
     "Trace data saved to file '${testfile}.tf'.*"
+# Save trace frames to ctf.
+gdb_test "tsave -ctf ${testfile}.ctf" \
+    "Trace data saved to directory '${testfile}.ctf'.*"
 
 proc check_tsv { data_source } { with_test_prefix "${data_source}" {
     gdb_test "tfind 0"
@@ -170,3 +173,20 @@ gdb_test_multiple "target tfile ${testfile}.tf" "$test" {
 
 # Check the tsv from tfile.
 check_tsv "tfile"
+
+# Save trace frames to ctf format if GDB is able to read ctf data.
+set gdb_can_read_ctf_data 0
+gdb_test_multiple "target ctf" "" {
+    -re "Undefined target command: \"ctf\"\.  Try \"help target\"\.\r\n$gdb_prompt $" {
+	set gdb_can_read_ctf_data 0
+    }
+    -re "No CTF directory specified.*\r\n$gdb_prompt $" {
+	set gdb_can_read_ctf_data 1
+    }
+}
+
+if { $gdb_can_read_ctf_data } {
+    # Change target to ctf.
+    gdb_test "target ctf ${testfile}.ctf" ".*" "change to ctf target"
+    check_tsv "ctf"
+}
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]