[PATCH 5/5] ctf test: report.exp

Yao Qi
2013-02-27T02:19:07Z

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

This patch depends on this patch,

[PATCH 1/2] Check trace data from trace file
http://sourceware.org/ml/gdb-patches/2013-02/msg00611.html

gdb/testsuite:

2013-02-27 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 | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
index b32bca1..d074c1f 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 report.ctf" \
+ "Trace data saved to directory 'report.ctf'.*"
+
# Change target to tfile.
set test "change to tfile target"
gdb_test_multiple "target tfile report.tf" "$test" {
@@ -421,3 +425,20 @@ gdb_test_multiple "target tfile report.tf" "$test" {
}
# Test the collected trace frames from tfile.
use_collected_data "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_no_output "target ctf report.ctf" "change to ctf target"
+ use_collected_data "ctf"
+}
--
1.7.7.6