From 3093eb55ac4a7054f51f06ea2786b5f9c9ec73f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 11 Nov 2026 14:43:13 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/src/root.zig | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'anim/src/root.zig') diff --git a/anim/src/root.zig b/anim/src/root.zig index b7be9b4..78da9dc 100644 --- a/anim/src/root.zig +++ b/anim/src/root.zig @@ -220,7 +220,7 @@ pub const map = @import("map.zig"); pub const Context = struct { stage: *Stage, /// The working frame unfolded (`map.Map`): its panels, on a stage of its - /// own; drawn small as the minimap. A lens adds its drawing with `map.add`. + /// own; each pane's column of it is the pane's strip. A lens adds its drawing with `map.add`. map: *map.Map, clock: anim.Obj, source: anim.Obj, @@ -288,18 +288,29 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex const stage = Stage.init(s, options.split); var at = cursor_; at.levels.crossings = options.syscalls; - // The map first: while it fills the frame or falls to the minimap it is under the panels diving out of it. + // The map first: while it fills the frame it is under the panels diving out of it. const whole = s.new(map.Map{ .stage = Stage.init(s, map.split(at.rec, options.split.band.h > 0, .{ at.first, at.last }, options.graph)), .frame = stage, .t = s.value(map.diving.land + map.diving.still), .cursor = at, .graph = options.graph }); whole.obj = s.custom(whole, .{ .x = -640, .y = -360, .scale = ui.scale }); - whole.add(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent }); - whole.add(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent, .part = .source_more }); - if (options.graph) whole.add(s, graph.Map{ .cursor = at, .stage = whole.stage }) else if (options.descent) whole.add(s, Descent{ .cursor = at, .stage = whole.stage }) else whole.add(s, Disasm{ .cursor = at, .stage = whole.stage }); - whole.add(s, Registers{ .cursor = at, .stage = whole.stage, .syscalls = options.syscalls, .quiet = options.quiet }); - whole.add(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above }); + whole.addIn(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent }, .both, .source); + whole.addIn(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent, .part = .source_more }, .both, .source); + // The disassembly's strip is its linear column: where the map draws a + // graph or a descent, the rows round the pc are drawn for the strip alone. + if (options.graph) { + whole.linear = Stage.init(s, map.split(at.rec, options.split.band.h > 0, .{ at.first, at.last }, false)); + whole.addIn(s, graph.Map{ .cursor = at, .stage = whole.stage }, .map, .disasm); + whole.addIn(s, Disasm{ .cursor = at, .stage = whole.linear.?, .measures = false }, .strips, .disasm); + } else if (options.descent) { + whole.addIn(s, Descent{ .cursor = at, .stage = whole.stage }, .map, .disasm); + whole.addIn(s, Disasm{ .cursor = at, .stage = whole.stage, .measures = false }, .strips, .disasm); + } else whole.addIn(s, Disasm{ .cursor = at, .stage = whole.stage }, .both, .disasm); + whole.addIn(s, Registers{ .cursor = at, .stage = whole.stage, .syscalls = options.syscalls, .quiet = options.quiet }, .map, .registers); + whole.addIn(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above }, .both, .stack); // The stack goes on in the rest of the memory's column, from where its own column ends. - whole.add(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above - @as(i32, @intCast(theme.layout.rowsIn(whole.stage.first.stack.h))), .part = .more }); - whole.add(s, Backtrace{ .cursor = at, .stage = whole.stage }); - whole.add(s, map.Spare{ .cursor = at, .stage = whole.stage, .map = whole }); + whole.addIn(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above - @as(i32, @intCast(theme.layout.rowsIn(whole.stage.first.stack.h))), .part = .more }, .both, .stack); + whole.addIn(s, Backtrace{ .cursor = at, .stage = whole.stage }, .map, .backtrace); + // The rest of the first two columns: no pane's. + whole.addIn(s, map.Spare{ .cursor = at, .stage = whole.stage, .map = whole }, .map, .backtrace); + map.current = whole; return .{ .stage = stage, .map = whole, -- cgit v1.3