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/tracepoint.c | |
parent | 045dd51fd8dd7ae16b74d5154156b2d984d021b9 (diff) | |
download | gdb-8ddb196517f30b5e304663e428f345daf030230b.zip gdb-8ddb196517f30b5e304663e428f345daf030230b.tar.gz 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/tracepoint.c')
-rw-r--r-- | gdb/tracepoint.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 7f27bc0..513dccc 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -4655,7 +4655,12 @@ static int tfile_get_trace_state_variable_value (int tsvnum, LONGEST *val) { int pos; + int found = 0; + /* Iterate over blocks in current frame and find the last 'V' + block in which tsv number is TSVNUM. In one trace frame, there + may be multiple 'V' blocks created for a given trace variable, + and the last matched 'V' block contains the updated value. */ pos = 0; while ((pos = traceframe_find_block_type ('V', pos)) >= 0) { @@ -4671,13 +4676,12 @@ tfile_get_trace_state_variable_value (int tsvnum, LONGEST *val) *val = extract_signed_integer ((gdb_byte *) val, 8, gdbarch_byte_order (target_gdbarch ())); - return 1; + found = 1; } pos += (4 + 8); } - /* Didn't find anything. */ - return 0; + return found; } static int |