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 2/5] Check TSV value from the remote target and trace file.


This patch improves tsv.exp to cover the case that reading TSV from
the live target and tfile target.  Run patched tsv.exp will get
two FAILs caused by a bug.

  FAIL: gdb.trace/tsv.exp: live: Print a trace state variable
  FAIL: gdb.trace/tsv.exp: tfile: Print a trace state variable

The next patch is to fix this bug.

gdb/testsuite:

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

	* gdb.trace/tsv.exp (check_tsv): New.
	(top level): Save a tfile on current trace session. Call
	check_tsv on live target.  Load the tfile with target tfile
	and call check_tsv again.
---
 gdb/testsuite/gdb.trace/tsv.exp |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index bab0a10..97dcaba 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -142,7 +142,31 @@ gdb_test "print \$tvar5" " = 16" \
 
 gdb_test_no_output "tstop" ""
 
-gdb_test "print \$tvar5" " = 16" \
-    "Print a trace state variable after run"
-
+# Save trace frames to tfile.
+gdb_test "tsave ${testfile}.tf" \
+    "Trace data saved to file '${testfile}.tf'.*"
+
+proc check_tsv { data_source } { with_test_prefix "${data_source}" {
+    gdb_test "tfind 0"
+    gdb_test "print \$tvar5" " = 16" \
+	"Print a trace state variable"
+    gdb_test "tfind" "Target failed to find requested trace frame.*"
+}}
+
+# Check the tsv from the remote target.
+check_tsv "live"
+
+# Change target to tfile.
+set test "change to tfile target"
+gdb_test_multiple "target tfile ${testfile}.tf" "$test" {
+    -re "A program is being debugged already.  Kill it. .y or n. " {
+	send_gdb "y\n"
+	exp_continue
+    }
+    -re "$gdb_prompt $" {
+	pass "$test"
+    }
+}
 
+# Check the tsv from tfile.
+check_tsv "tfile"
-- 
1.7.7.6


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