aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c61
1 files changed, 36 insertions, 25 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index ca104aa..9a80aa3 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -4316,35 +4316,46 @@ tfile_trace_find (enum trace_find_type type, int num,
((gdb_byte *) &data_size, 4,
gdbarch_byte_order (target_gdbarch ()));
offset += 4;
- switch (type)
+
+ if (type == tfind_number)
{
- case tfind_number:
+ /* Looking for a specific trace frame. */
if (tfnum == num)
found = 1;
- break;
- case tfind_pc:
- tfaddr = tfile_get_traceframe_address (tframe_offset);
- if (tfaddr == addr1)
- found = 1;
- break;
- case tfind_tp:
- tp = get_tracepoint (num);
- if (tp && tpnum == tp->number_on_target)
- found = 1;
- break;
- case tfind_range:
- tfaddr = tfile_get_traceframe_address (tframe_offset);
- if (addr1 <= tfaddr && tfaddr <= addr2)
- found = 1;
- break;
- case tfind_outside:
- tfaddr = tfile_get_traceframe_address (tframe_offset);
- if (!(addr1 <= tfaddr && tfaddr <= addr2))
- found = 1;
- break;
- default:
- internal_error (__FILE__, __LINE__, _("unknown tfind type"));
}
+ else
+ {
+ /* Start from the _next_ trace frame. */
+ if (tfnum > traceframe_number)
+ {
+ switch (type)
+ {
+ case tfind_pc:
+ tfaddr = tfile_get_traceframe_address (tframe_offset);
+ if (tfaddr == addr1)
+ found = 1;
+ break;
+ case tfind_tp:
+ tp = get_tracepoint (num);
+ if (tp && tpnum == tp->number_on_target)
+ found = 1;
+ break;
+ case tfind_range:
+ tfaddr = tfile_get_traceframe_address (tframe_offset);
+ if (addr1 <= tfaddr && tfaddr <= addr2)
+ found = 1;
+ break;
+ case tfind_outside:
+ tfaddr = tfile_get_traceframe_address (tframe_offset);
+ if (!(addr1 <= tfaddr && tfaddr <= addr2))
+ found = 1;
+ break;
+ default:
+ internal_error (__FILE__, __LINE__, _("unknown tfind type"));
+ }
+ }
+ }
+
if (found)
{
if (tpp)