summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-13 12:30:37 -0300
committerGabriel Schneider <[email protected]>2026-11-13 12:31:12 -0300
commit5adffa613619eea42405d0cfdb402705e0f4751f (patch)
tree5835048cf6a29a449182fba71c67a2583ed6335d /gui
parent4f31aaef1338b53195f8c475db5a72d75cc1fc82 (diff)
downloadcomputeranim-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 'gui')
-rw-r--r--gui/README.md4
-rw-r--r--gui/bench/RESULTS.md9
-rw-r--r--gui/targets/segments.c3
-rw-r--r--gui/test/lenses.py42
4 files changed, 57 insertions, 1 deletions
diff --git a/gui/README.md b/gui/README.md
index b355665..288261e 100644
--- a/gui/README.md
+++ b/gui/README.md
@@ -96,7 +96,9 @@ Memory's two header controls choose 8/16/32/64-bit groups and hexadecimal,
unsigned, signed or floating-point values (little endian). `memory-format SIZE
FORMAT` sets byte sizes 1/2/4/8 and `hex`, `unsigned`, `signed` or `float` directly;
floats require 4 or 8 bytes. Unknown bytes stay unknown; these controls only
-change rendering. Wide values remain reachable with Shift-h/l.
+change rendering. Recognized pointer fields are clickable across all their bytes,
+including 8-bit view: left-click opens a lens; right-click opens stack or memory.
+Wide values remain reachable with Shift-h/l.
Lenses keep an opaque reading surface, with a native GPU backdrop shader for
edge refraction, subtle color separation and a cyan rim. A canvas-sized texture and one reusable lens snapshot
diff --git a/gui/bench/RESULTS.md b/gui/bench/RESULTS.md
index e0c5626..54ecf4e 100644
--- a/gui/bench/RESULTS.md
+++ b/gui/bench/RESULTS.md
@@ -187,3 +187,12 @@ recording `/tmp/ztrace-gui-17379-8471380224093.ztrace`. Generated wrong-map exit
`0x7f4c80c01fba`, the printed wrong-map return for the naturally optimized
`jitWork`. Origin context and the executable lens use guard `0x7f4c80c01bd4`.
The target remains stopped; lens inspection only captures bytes and instructions.
+
+Hexdump pointer follow-up: shared byte/grouped-integer rows now expose the full
+pointer span to both mouse buttons, including 8-bit display and zero padding.
+Native/headless checks cover 8/16/32/64-bit groups, recursive byte-view lenses,
+and a stack pointer stored in data. GUI and shared-renderer suites pass.
+The updated native session (GUI20122, d8 20207) remains at `Deoptimizer::New+4`
+`0x7f24dbbe3f74`, with wrong-map origin `0x7f247ac00ffa` and JS guard
+`0x7f247ac00c14`; recording `/tmp/ztrace-gui-20122-9224949592653.ztrace`.
+A native 8-bit hexdump click opened the saved-stack-pointer lens successfully.
diff --git a/gui/targets/segments.c b/gui/targets/segments.c
index 0fdc25f..c52ad3b 100644
--- a/gui/targets/segments.c
+++ b/gui/targets/segments.c
@@ -7,9 +7,12 @@
struct node { struct node *next; uint64_t value; };
struct node head, middle, tail;
volatile uint64_t counter;
+uint64_t *stack_pointer;
__attribute__((noinline)) void checkpoint(void) { __asm__ volatile("" ::: "memory"); }
int main(void) {
+ uint64_t stack_value = 42;
+ stack_pointer = &stack_value;
const size_t size = (size_t)1 << 32;
int fd = memfd_create("ztrace-test-segment", 0);
assert(fd >= 0 && ftruncate(fd, size) == 0);
diff --git a/gui/test/lenses.py b/gui/test/lenses.py
index c78e250..9d287fa 100644
--- a/gui/test/lenses.py
+++ b/gui/test/lenses.py
@@ -84,6 +84,46 @@ expect number_format float
click 1278 822
expect number_format hex
'''
+ # Pointer hits cover the full eight-byte field, independently of grouping.
+ for unit in (1, 2, 4, 8):
+ commands += f'''console memory-format {unit} hex
+console goto memory {head}
+frames 40
+click 1270 863
+expect lens_count 1
+expect lenses[0].address {symbols['middle']}
+key escape
+console mouse-button 3 1270 863
+expect focus memory
+expect nav[2].place.address {symbols['middle']}
+'''
+ commands += f'''console memory-format 1 hex
+console goto memory {head}
+frames 40
+# The last (zero) byte of a little-endian pointer follows the full pointer too.
+click 1480 863
+expect lenses[0].address {symbols['middle']}
+frames 30
+# The pointer's bytes in a recursive lens use the same shared hit geometry.
+click 1250 231
+expect lens_count 2
+expect lenses[1].address {symbols['tail']}
+key escape
+# A stack pointer stored in ordinary data routes by its target mapping.
+console goto memory {symbols['stack_pointer']}
+frames 40
+click {1270 + (symbols['stack_pointer'] % 16) * 30 + (12 if symbols['stack_pointer'] % 16 >= 8 else 0)} 863
+expect lens_count 1
+print lenses[0].address
+key escape
+console mouse-button 3 {1270 + (symbols['stack_pointer'] % 16) * 30 + (12 if symbols['stack_pointer'] % 16 >= 8 else 0)} 863
+expect focus stack
+print nav[1].place.address
+expect nav[1].place.follow false
+expect execution 1
+console goto memory {head}
+frames 40
+'''
for unit in (1, 2, 4, 8):
for fmt in ('hex', 'unsigned', 'signed') + (('float',) if unit >= 4 else ()):
commands += f'console memory-format {unit} {fmt}\nexpect unit {unit}\nexpect number_format {fmt}\nframes 2\n'
@@ -114,6 +154,8 @@ expect-no-log backdrop shader
assert run.returncode == 0, stderr
first = int(re.search(r'lenses\[0\].first = (\d+)', stderr)[1])
assert first > code, (first, code)
+ stack_addresses = re.findall(r'(?:lenses\[0\].address|nav\[1\].place.address) = (\d+)', stderr)
+ assert len(stack_addresses) == 2 and stack_addresses[0] == stack_addresses[1], stack_addresses
stops = re.findall(r'stops = (\d+)', stderr)
assert len(stops) == 2 and stops[0] == stops[1], stops
for recording in Path('/tmp').glob(f'ztrace-gui-{run.pid}-*.ztrace'):