diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 23:36:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 23:55:42 -0300 |
| commit | 81d97a9e38c740a96af13a8a981878947a508bc0 (patch) | |
| tree | bbe53f2f4c195f378a5a8cb67dfac1277ac68c82 /anim/src/objects.zig | |
| parent | 2a46b60e1d115ff5149a112bc0f800467c0efaee (diff) | |
| download | computeranim-81d97a9e38c740a96af13a8a981878947a508bc0.tar.gz computeranim-81d97a9e38c740a96af13a8a981878947a508bc0.zip | |
canim: quieter marks, the stack's roles, the loupe, arcs, the minimap, the map and the dive
From the user's notes on the second videos. The current row is a white
wash, a strike a softened vermilion, held a turned corner. A stack row
has its offset from rsp and its role from the tracer (a saved register,
a local by name, argc and argv). The loupe is the telescope as a floating
panel: the memory round what a pointer leads to, a pointer inside it
opening the next. A pointer to a row of its own panel is an arc in a
lane, in dumps, loupes and the stack. Every scene has the minimap; the
map is the same moment with every panel at full length on 3840 by 2160,
and the list opens on it and dives to the working frame, each panel
travelling to its place. Recordings hold more round each stop.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/objects.zig')
| -rw-r--r-- | anim/src/objects.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/anim/src/objects.zig b/anim/src/objects.zig index 0c4f48a..6ee2b4c 100644 --- a/anim/src/objects.zig +++ b/anim/src/objects.zig @@ -15,6 +15,8 @@ pub const Object = struct { slot: ?usize, /// Its allocation is gone: something still points at freed memory. freed: bool, + /// Its type's name, where the debug info names it (`struct node`). + name: []const u8 = "", pub fn holds(o: Object, addr: u64) bool { return addr >= o.addr and addr - o.addr < o.type.record.size; @@ -60,9 +62,14 @@ fn follow(scratch: std.mem.Allocator, rec: *const Recording, m: Recording.Moment if (t != .record) return; const addr = (Recording.word(m, at, 8) catch return) orelse return; if (addr == 0) return; - for (found.items) |o| if (o.addr == addr) return; + const name = if (pointee == .named) pointee.named else ""; + // Met again through a pointer that names it as C does (`struct node`, not a typedef): that name. + for (found.items) |*o| if (o.addr == addr) { + if (std.mem.startsWith(u8, name, "struct ") or std.mem.startsWith(u8, name, "union ")) o.name = name; + return; + }; const live = (m.allocation(addr) catch null) != null; - found.append(scratch, .{ .addr = addr, .type = t, .slot = slotOf(rec, addr, m), .freed = !live and wasAllocated(rec, addr, m.index) }) catch {}; + found.append(scratch, .{ .addr = addr, .type = t, .slot = slotOf(rec, addr, m), .freed = !live and wasAllocated(rec, addr, m.index), .name = name }) catch {}; } /// The place of the allocation at `addr` among every allocation of its |
