From 378379807fb4cd751e90808c8363caddb365bcd8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 06:49:10 -0300 Subject: canim: nothing changes in one frame; the map's space is used; the heap scene at its storyboard's length The motion check counts a third of the one-frame changes it did: the minimap's changes fade, and a register's value, a flag, a role, a pin's names, a tag's note, a backtrace row, a call tree's node and a dump row crossfade where they changed at once. What still fires is named in the README; an encoder's keyframe and the gallery's cuts are exempt by name. No caption stands over twelve seconds or under its reading time. The heap scene is 78 s: what the storyboard does not narrate runs, and each free's line cascades onto its call row (line stepping stops at a breakpoint for that). On the map, leftover space holds the stack continued, dumps round what the registers and the stack point at, open loupes and the key: between 1% and 13% of a map is page, where it was 14% to 42%. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/build.zig | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'anim/build.zig') diff --git a/anim/build.zig b/anim/build.zig index d12912d..5601e39 100644 --- a/anim/build.zig +++ b/anim/build.zig @@ -87,6 +87,10 @@ pub fn build(b: *std.Build) void { /// Also glibc's heap at every stop (`--heap`), and memory watched (`-w`). heap: bool = false, watch: []const []const u8 = &.{}, + /// Also a stop at the call, in function [0], of function [1] through + /// its PLT stub (found by objdump: there is no name for it): the row + /// a line's cascade lands on before the call is stepped over. + break_call: ?[2][]const u8 = null, }; for ([_]Recording{ .{ .name = "steps", .source = "fib.c", .by = "insn" }, @@ -94,7 +98,7 @@ pub fn build(b: *std.Build) void { // the kernel and back: the descent; to main's return. .{ .name = "hello", .source = "hello.c", .by = "insn", .from = "main", .steps = "132", .glibc = true, .reads = "note" }, // A line a stop, malloc and free run through; glibc's heap at each. - .{ .name = "heap", .source = "heap.c", .by = "line", .from = "main", .glibc = true, .heap = true, .watch = &.{ "0x405000,1024", "head" } }, + .{ .name = "heap", .source = "heap.c", .by = "line", .from = "main", .glibc = true, .heap = true, .watch = &.{ "0x405000,1024", "head" }, .break_call = .{ "pop", "free" } }, // By instruction, as `steps` is: the registers are the program's // own, so they strike and link. Only the variables the scenes name // are told by the instrumentation (each a call into its runtime, @@ -135,13 +139,24 @@ pub fn build(b: *std.Build) void { const where = b.addWriteFiles(); _ = where.addCopyFile(program, r.name); if (r.reads) |name| _ = where.addCopyFile(b.path(b.fmt("tools/{s}", .{name})), name); - const run = b.addSystemCommand(&.{ "env", "-i", "setarch", "-R" }); + const run = if (r.break_call) |call| blk: { + // The call's address, from the program as built, then the recorder with a breakpoint there. + const sh = b.addSystemCommand(&.{ "sh", "-c", b.fmt( + \\p=$0 z=$1; shift + \\at=$(objdump -d --no-show-raw-insn "$p" | awk '/<{s}>:/ {{ f = 1 }} f && /call.*<{s}@plt>/ {{ sub(":", "", $1); print "0x" $1; exit }}') + \\[ -n "$at" ] || {{ echo "no call of {s} in {s}" >&2; exit 1; }} + \\exec env -i setarch -R "$z" record -b "*$at" "$@" + , .{ call[0], call[1], call[1], call[0] }) }); + sh.addFileArg(program); + break :blk sh; + } else b.addSystemCommand(&.{ "env", "-i", "setarch", "-R" }); run.addArtifactArg(ztrace); // More round each stop than the working frame shows: the map of // the whole context wants the words of the stack, 256 bytes round // what a pointer leads to and what a step touches, and 69 // instructions round the pc. - run.addArgs(&.{ "record", "--by", r.by, "--stack", r.stack, "--around", "256", "--disasm", "69", "-s", "64" }); + if (r.break_call == null) run.addArg("record"); + run.addArgs(&.{ "--by", r.by, "--stack", r.stack, "--around", "256", "--disasm", "69", "-s", "64" }); if (r.from) |place| run.addArgs(&.{ "--from", place }); if (r.steps) |n| run.addArgs(&.{ "--steps", n }); if (r.heap) run.addArg("--heap"); -- cgit v1.3