aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog5
-rw-r--r--gdb/gdbserver/tracepoint.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 9a5ae02..a7289fd 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-13 Yao Qi <yao@codesourcery.com>
+
+ * tracepoint.c (traceframe_read_tsv): Look for the last matched
+ 'V' block in trace frame.
+
2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
* target.h (struct target_ops): Add btrace ops.
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index dcc2e78..bea6202 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -5257,6 +5257,7 @@ traceframe_read_tsv (int tsvnum, LONGEST *val)
unsigned char *database, *dataptr;
unsigned int datasize;
int vnum;
+ int found = 0;
trace_debug ("traceframe_read_tsv");
@@ -5279,7 +5280,8 @@ traceframe_read_tsv (int tsvnum, LONGEST *val)
datasize = tframe->data_size;
database = dataptr = &tframe->data[0];
- /* Iterate through a traceframe's blocks, looking for the tsv. */
+ /* Iterate through a traceframe's blocks, looking for the last
+ matched tsv. */
while ((dataptr = traceframe_find_block_type (dataptr,
datasize
- (dataptr - database),
@@ -5294,16 +5296,17 @@ traceframe_read_tsv (int tsvnum, LONGEST *val)
if (tsvnum == vnum)
{
memcpy (val, dataptr, sizeof (*val));
- return 0;
+ found = 1;
}
/* Skip over this block. */
dataptr += sizeof (LONGEST);
}
- trace_debug ("traceframe %d has no data for variable %d",
- tfnum, tsvnum);
- return 1;
+ if (!found)
+ trace_debug ("traceframe %d has no data for variable %d",
+ tfnum, tsvnum);
+ return !found;
}
/* Read a requested block of static tracepoint data from a trace