diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 20:16:54 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 20:27:13 -0300 |
| commit | dc3b58781420be6070fca896e55776bc27db905d (patch) | |
| tree | f77ebd77edf5a360df0ea9255f55daf47e5baf34 /anim/src/calls.zig | |
| parent | 13fe4003276daf884da4e29112fb4db8630ad46a (diff) | |
| download | computeranim-dc3b58781420be6070fca896e55776bc27db905d.tar.gz computeranim-dc3b58781420be6070fca896e55776bc27db905d.zip | |
canim: a scene from a real program: SQLite's row on its way to disk
Three inserts stopped at sqlite3BtreeInsert with their payloads read off
the caller's stack, the commit's backtrace from unixWrite up to main, the
pwrite64 crossing into the kernel, and page 2 as the kernel took it: its
header, its cell pointers and the three rows, read by field. The scene
is built only where SQLite's source is (-Dsqlite=DIR); its recording is
181 moments, 95 KB.
What a real program asked of the blocks: a dump read by the fields a
scene gives it, with the rows between collapsed; addresses of twelve
digits and line numbers of six; the backtrace as a lens's drawing; a
continue's motion (shared frames slide, a far window fades); memory drawn
only where the stop read it. In the kernel lens a register is framed as
carrying an argument only while it holds it at the stop shown, and an
allocator row is read only where an allocation follows the word.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diffstat (limited to 'anim/src/calls.zig')
| -rw-r--r-- | anim/src/calls.zig | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/anim/src/calls.zig b/anim/src/calls.zig index e66da1a..0765ce4 100644 --- a/anim/src/calls.zig +++ b/anim/src/calls.zig @@ -153,11 +153,7 @@ pub const Tree = struct { const y = body.y + cm.pad + @as(f32, @floatFromInt(i)) * cm.row; const name = ui.symbol(u, rec.strings.get(frame.pc) orelse u.print("{x}", .{frame.pc})); // The call this frame is, by its place on the chain: its arguments. - const call: ?Recording.Call = if (i < open.len) open[open.len - 1 - i] else null; - const args = if (call) |c| arguments(u, rec, c) else ""; - const line = if (i == 0) rec.own[now.marked()] else rec.lineOf(frame.pc) orelse 0; - const where = if (line > 0 and (i == 0 or rec.lineOf(frame.pc) != null)) u.print("{s}:{d}", .{ rec.file, line }) else ""; - rows.callRow(u, y, box.w, i, name, args, where, i == 0); + rows.callRow(u, y, box.w, i, name, context.callArguments(u, rec, open, i, frame.pc), context.frameWhere(u, rec, now.marked(), i, frame.pc), i == 0); } context.veiled(u, box, now.sprint_veil); } @@ -172,6 +168,8 @@ pub fn arguments(u: ui.Ui, rec: *const Recording, c: Recording.Call) []const u8 if (!f.takes) return ""; const arg = c.arg orelse return ""; const name = if (c.parameter_name) |id| rec.name(id) else f.param; + // A pointer is an address, hex; a number is its decimal. + if (rows.regionOf(rec.moment(c.enter), arg) != .none) return u.print("{s}={x}", .{ name, arg }); return u.print("{s}={d}", .{ name, @as(i64, @bitCast(arg)) }); } |
