[PATCH v3 05/15] ctf test: report.exp

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

This is a test to see GDB gets the same output as live target and
TFILE trace format.

In V3, we remove the code checking target 'ctf' exists or not, just
issue the command "target ctf report.ctf", if the command is
recognized by GDB, do the tests otherwise, do nothing.

gdb/testsuite:

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

* gdb.trace/report.exp: Test GDB saves trace data to CTF
format and read CTF trace file if GDB supports.
---
gdb/testsuite/gdb.trace/report.exp | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index b32bca1..fc5f711 100644
--- a/gdb/testsuite/gdb.trace/report.exp
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -408,6 +408,10 @@ gdb_tfind_test "finished: make sure not debugging any trace frame" \
# Save trace frames to tfile.
gdb_test "tsave report.tf" "Trace data saved to file 'report.tf'.*"

+# Save trace frames to ctf.
+gdb_test "tsave -ctf ${testfile}.ctf" \
+ "Trace data saved to directory '${testfile}.ctf'.*"
+
# Change target to tfile.
set test "change to tfile target"
gdb_test_multiple "target tfile report.tf" "$test" {
@@ -421,3 +425,12 @@ gdb_test_multiple "target tfile report.tf" "$test" {
}
# Test the collected trace frames from tfile.
use_collected_data "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 $" {
+ use_collected_data "ctf"
+ }
+}
--
1.7.7.6