diff options
author | Yao Qi <yao@codesourcery.com> | 2013-03-13 03:40:27 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-03-13 03:40:27 +0000 |
commit | 8ddb196517f30b5e304663e428f345daf030230b (patch) | |
tree | c7d0996f2f0192f644f105aa7c6e111b50060c27 /gdb/testsuite | |
parent | 045dd51fd8dd7ae16b74d5154156b2d984d021b9 (diff) | |
download | fsf-binutils-gdb-8ddb196517f30b5e304663e428f345daf030230b.zip fsf-binutils-gdb-8ddb196517f30b5e304663e428f345daf030230b.tar.gz fsf-binutils-gdb-8ddb196517f30b5e304663e428f345daf030230b.tar.bz2 |
* tracepoint.c (tfile_get_trace_state_variable_value): Look for
the last matched 'V' blcok in trace frame.
gdb/gdbserver:
* tracepoint.c (traceframe_read_tsv): Look for the last matched
'V' block in trace frame.
gdb/testsuite:
* 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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.trace/tsv.exp | 33 |
2 files changed, 38 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 588b0b3..37eecbb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,12 @@ 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. + +2013-03-13 Yao Qi <yao@codesourcery.com> + * gdb.trace/tsv.exp: Remove code unrelated to testing TSV. Replace some "gdb_test" with "gdb_test_no_output". 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" |