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]

Re: [PATCH 2/5] Check TSV value from the remote target and trace file.


On 03/13/2013 01:28 AM, Tom Tromey wrote:
Would you mind using standard_output_file to name the .tf file?
That would help my eventual test suite patches.


No problem.


Yao> +proc check_tsv { data_source } { with_test_prefix "${data_source}" {

I know we have this formatting elsewhere, but it is not really correct.
Put the with_test_prefix on a new line, reindent the body, and...


You reminded me about this last year, but I remembered the comments incorrectly. Sorry and get them fixed.

Yao> +    gdb_test "tfind 0"
Yao> +    gdb_test "print \$tvar5" " = 16" \
Yao> +	"Print a trace state variable"
Yao> +    gdb_test "tfind" "Target failed to find requested trace frame.*"
Yao> +}}

... split the "}}".


Fixed.


Ok with these changes.

Below is what I committed.


--
Yao (éå)

gdb/testsuite:

2013-03-13 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 |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.trace/tsv.exp b/gdb/testsuite/gdb.trace/tsv.exp
index bab0a10..de523fd 100644
--- a/gdb/testsuite/gdb.trace/tsv.exp
+++ b/gdb/testsuite/gdb.trace/tsv.exp
@@ -142,7 +142,36 @@ 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.
+set tracefile [standard_output_file ${testfile}]
+gdb_test "tsave ${tracefile}.tf" \
+    "Trace data saved to file '${tracefile}.tf'.*" \
+    "save tfile trace file"
+
+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 live inferior.
+check_tsv "live"
+
+# Change target to tfile.
+set test "change to tfile target"
+gdb_test_multiple "target tfile ${tracefile}.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]