[PATCH v3 14/15] Test on saving tracepoint defs: CTF

Yao Qi
2013-03-09T03:49:34Z

Similarly, we have to exercise the CTF code on writing actions to
trace file and restoring them.

gdb/testsuite:

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

* gdb.trace/actions.exp: Save trace data to CTF.
Change to ctf target if GDB supports, read CTF data in ctf
target, and check the actions of tracepoints.
* gdb.trace/while-stepping.exp: Likewise.
---
gdb/testsuite/gdb.trace/actions.exp | 17 +++++++++++++++++
gdb/testsuite/gdb.trace/while-stepping.exp | 17 +++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
index 7bbe6b6..0a77365 100644
--- a/gdb/testsuite/gdb.trace/actions.exp
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -308,6 +308,8 @@ check_tracepoint "live"
gdb_test_no_output "tstop" ""
gdb_test "tsave ${testfile}.tf" \
"Trace data saved to file '${testfile}.tf'\.\\r"
+gdb_test "tsave -ctf ${testfile}.ctf" \
+ "Trace data saved to directory '${testfile}.ctf'\.\\r"

# Restart GDB and read the trace data in tfile target.
gdb_exit
@@ -317,3 +319,18 @@ gdb_file_cmd $binfile
gdb_test "target tfile ${testfile}.tf" ".*" \
"change to tfile target"
check_tracepoint "tfile"
+
+# Try to read ctf data if GDB supports.
+gdb_test_multiple "target ctf ${testfile}.ctf" "" {
+ -re "Undefined target command: \"ctf ${testfile}.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" {
+ }
+ -re ".*\r\n$gdb_prompt $" {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_file_cmd $binfile
+ gdb_test "target ctf ${testfile}.ctf" ".*" \
+ "change to ctf target"
+ check_tracepoint "ctf"
+ }
+}
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
index 0f316eb..e057fab 100644
--- a/gdb/testsuite/gdb.trace/while-stepping.exp
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -132,6 +132,8 @@ check_tracepoint "live"
gdb_test_no_output "tstop"
gdb_test "tsave ${testfile}.tf" \
"Trace data saved to file '${testfile}.tf'\.\\r"
+gdb_test "tsave -ctf ${testfile}.ctf" \
+ "Trace data saved to directory '${testfile}.ctf'\.\\r"

# Restart GDB and read the trace data in tfile target.
gdb_exit
@@ -141,3 +143,18 @@ gdb_file_cmd $binfile
gdb_test "target tfile ${testfile}.tf" ".*" \
"change to tfile target"
check_tracepoint "tfile"
+
+# Try to read ctf data if GDB supports.
+gdb_test_multiple "target ctf ${testfile}.ctf" "" {
+ -re "Undefined target command: \"ctf ${testfile}.ctf\"\. Try \"help target\"\.\r\n$gdb_prompt $" {
+ }
+ -re ".*\r\n$gdb_prompt $" {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_file_cmd $binfile
+ gdb_test "target ctf ${testfile}.ctf" ".*" \
+ "change to ctf target"
+ check_tracepoint "ctf"
+ }
+}
--
1.7.7.6