From 65288208affd7ae28dd8bb6fce2ed8710aa37390 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Mon, 11 May 2026 17:33:42 -0700 Subject: [PATCH] dbg_engine: extend trap-net range across contiguous same-source-line ranges --- src/dbg_engine/dbg_engine_user.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/dbg_engine/dbg_engine_user.c b/src/dbg_engine/dbg_engine_user.c index bfca5f1c..ae1f5d13 100644 --- a/src/dbg_engine/dbg_engine_user.c +++ b/src/dbg_engine/dbg_engine_user.c @@ -377,6 +377,23 @@ d_trap_net_from_thread__step_over_line(Arena *arena, D_Entity *thread) rng1u64_list_push(scratch.arena, &all_vaddr_ranges_on_same_line, vaddr_range); } } + + // extend trap-net range across contiguous same-source-line, possibly unsorted, ranges + // + // TODO: @ns: converter should never produce these ranges in the first place, + // once fixed, assert this invariant + for(B32 changed = 1; changed;) + { + changed = 0; + for EachNode(n, Rng1U64Node, all_vaddr_ranges_on_same_line.first) + { + if(n->v.min <= line_vaddr_rng.max && line_vaddr_rng.max < n->v.max) + { + line_vaddr_rng.max = n->v.max; + changed = 1; + } + } + } // rjf: opl line_vaddr_rng -> 0xf00f00 or 0xfeefee? => include in line vaddr range //