diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-13 12:30:37 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-13 12:31:12 -0300 |
| commit | 5adffa613619eea42405d0cfdb402705e0f4751f (patch) | |
| tree | 5835048cf6a29a449182fba71c67a2583ed6335d /anim/src | |
| parent | 4f31aaef1338b53195f8c475db5a72d75cc1fc82 (diff) | |
| download | computeranim-5adffa613619eea42405d0cfdb402705e0f4751f.tar.gz computeranim-5adffa613619eea42405d0cfdb402705e0f4751f.zip | |
debugger: make hexdump pointer bytes clickable in every integer grouping
Publish full pointer spans from the shared byte renderer and grouped numeric rows. Both mouse buttons now use the existing lens/navigation handlers even in 8-bit view, including zero padding. Reject pointer hits when any constituent byte is uncaptured.
Verified native/headless left and right clicks, recursive lenses, stack destinations, and GUI/shared-renderer suites.
Diffstat (limited to 'anim/src')
| -rw-r--r-- | anim/src/rows.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/anim/src/rows.zig b/anim/src/rows.zig index 0e4f58c..3d0c75c 100644 --- a/anim/src/rows.zig +++ b/anim/src/rows.zig @@ -68,6 +68,7 @@ pub fn wordsAt(u: ui.Ui, y: f32, addr: u64, values: *const [16]u8, known: *const std.debug.assert(unit == 1 or unit == 2 or unit == 4 or unit == 8); _ = u.address(theme.metric.bytes.address, baseline(y), addr, .{ .ink = ui.rgb(ink(regionOf(moment, addr))) }); var x = theme.metric.bytes.first + addressRoom(addr); + var pointer_x = x; var at_byte: usize = 0; while (at_byte < 16) : (at_byte += unit) { const octets = values[at_byte..][0..unit]; @@ -81,10 +82,12 @@ pub fn wordsAt(u: ui.Ui, y: f32, addr: u64, values: *const [16]u8, known: *const .float => if (unit == 8) 25 else 16, }; const width = @as(f32, @floatFromInt(digits)) * adv; - const value = if (unit == 8) std.mem.readInt(u64, octets[0..8], .little) else 0; - const pointer = captured and unit == 8 and format != .float and regionOf(moment, value) != .none; + const pointer_at = at_byte / 8 * 8; + if (at_byte == pointer_at) pointer_x = x; + const value = std.mem.readInt(u64, values[pointer_at..][0..8], .little); + const pointer = format != .float and std.mem.indexOfScalar(bool, known[pointer_at..][0..8], false) == null and regionOf(moment, value) != .none; u.text(.mono, size, x, baseline(y), text, if (pointer) ink(regionOf(moment, value)) else t.primary); - if (pointer) u.hitAddress(value, .{ .x = x, .y = y, .w = width, .h = row_h }); + if (pointer and at_byte + unit == pointer_at + 8) u.hitAddress(value, .{ .x = pointer_x, .y = y, .w = x + width - pointer_x, .h = row_h }); x += width + adv * 2; } return x; @@ -618,6 +621,7 @@ pub fn bytesAt(at: ui.Ui, y: f32, addr: u64, values: *const [16]u8, known: *cons top = j; }; const word: u64 = if (run.len == 8) std.mem.readInt(u64, values[run.first..][0..8], .little) else 0; + if (run.kind == .pointer and run.len == 8 and std.mem.indexOfScalar(bool, known[run.first..][0..8], false) == null) u.hitAddress(word, r); const run_ink: ui.Color = switch (run.kind) { .number => ui.rgb(t.primary), .pointer => ui.rgb(if (run.len == 8) ink(regionOf(moment, word)) else t.primary), |
