diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 14:43:13 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 16:17:33 -0300 |
| commit | 3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6 (patch) | |
| tree | f1bc91879a447f178dfaba39d0df107d01e557bd /anim/test/recordings.zig | |
| parent | a72831d5c322078260314c305ddd940e4967947d (diff) | |
| download | computeranim-3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6.tar.gz computeranim-3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6.zip | |
canim: a minimap in each pane; source wherever it can be had, libc's included
From the user. Each pane with more than it shows carries a strip of its
whole column at its right edge, the pane's window outlined and what
happens off it marked there; the corner minimap is gone and the dive
folds each column of the map into its pane's strip. The source panel
follows the pc into any file the build has: glibc's own, from the
distro's debuginfod by an optional step that caches them by build id
(zig build sources; nothing else touches the network), and musl's, from
Zig's lib directory. The syscalls scene shows open64.c on the way down,
and a new scene follows the same call through a Zig-built musl. A
graph's counts and inks are as of the moment shown.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/test/recordings.zig')
| -rw-r--r-- | anim/test/recordings.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/anim/test/recordings.zig b/anim/test/recordings.zig index ce5a9db..e3af983 100644 --- a/anim/test/recordings.zig +++ b/anim/test/recordings.zig @@ -210,3 +210,21 @@ test "libc's open at its syscall: the blocks never reached folded, no loop made const here = g.nodes[g.here.?]; try expect(here.y >= off and here.y + here.h <= off + room and g.w <= 1792); } + +test "the source follows the pc into musl's own files and back to main's line" { + // musl is built from Zig's sources with the program: its files are always the build's to give. + const rec = canim.open(recordings.musl); + const main = rec.call("main", 0); + try std.testing.expectEqualStrings("hello.c", rec.sources[rec.shown[main.enter].src].name()); + var files: [3]bool = @splat(false); + var back = false; + for (rec.shown[main.enter..], main.enter..) |s, i| { + const name = rec.sources[s.src].name(); + for ([_][]const u8{ "open.c", "__syscall_cp.c", "syscall_arch.h" }, &files) |want, *seen| seen.* = seen.* or (s.here and std.mem.eql(u8, name, want)); + // Where it is on a line of musl's, the panel shows it: never main's held over. + if (s.here) try expect(rec.sourced(i)); + back = back or (files[0] and s.here and std.mem.eql(u8, name, "hello.c") and s.line == 6); + } + for (files) |seen| try expect(seen); + try expect(back); +} |
