diff options
Diffstat (limited to 'anim/src/root.zig')
| -rw-r--r-- | anim/src/root.zig | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig index d8c2c76..84758f8 100644 --- a/anim/src/root.zig +++ b/anim/src/root.zig @@ -20,6 +20,8 @@ pub const layout = theme.layout; pub const ui = @import("ui.zig"); pub const Rect = theme.Rect; pub const Recording = @import("Recording.zig"); +/// The tracer's reader, for what a scene reads itself (`ztrace.heap.glibc`). +pub const ztrace = @import("ztrace"); const cursors = @import("cursor.zig"); pub const Cursor = cursors.Cursor; pub const Now = cursors.Now; @@ -35,7 +37,9 @@ pub const Stack = contexts.Stack; pub const Backtrace = contexts.Backtrace; /// The registers' tag: what an address's ink says. pub const contextLegend = contexts.legend; -pub const Disasm = @import("disasm.zig").Disasm; +pub const disasm = @import("disasm.zig"); +pub const Disasm = disasm.Disasm; +pub const Descent = @import("descent.zig").Descent; pub const calls = @import("calls.zig"); pub const CallTree = calls.Tree; pub const Nodes = @import("nodes.zig").Nodes; @@ -46,6 +50,7 @@ pub const Place = tying.Place; pub const Array = @import("array.zig").Array; pub const Loupe = @import("loupe.zig").Loupe; pub const syscalls = @import("syscalls.zig"); +pub const descent = @import("descent.zig"); pub const Crossing = syscalls.Crossing; pub const Timeline = syscalls.Timeline; pub const objects = @import("objects.zig"); @@ -235,6 +240,10 @@ pub const Context = struct { /// (eleven rows as subject, five beside), when how the program came /// to be here is the story; the scene adds the drawing's view. backtrace: bool = false, + /// The disassembly as a `descent`: a call followed down opens its + /// callee's window under the call row, and a system call the + /// kernel's under the `syscall` (step with `descent.step`). + descent: bool = false, }; /// The ties between the panes, drawn over everything added before. @@ -268,8 +277,8 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex // The map first: while it fills the frame or falls to the minimap 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)), .frame = stage, .t = s.value(map.diving.land + map.diving.still) }); whole.obj = s.custom(whole, .{ .x = -640, .y = -360, .scale = ui.scale }); - whole.add(s, Source{ .cursor = at, .stage = whole.stage }); - whole.add(s, Disasm{ .cursor = at, .stage = whole.stage }); + whole.add(s, Source{ .cursor = at, .stage = whole.stage, .descent = options.descent }); + 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.add(s, Backtrace{ .cursor = at, .stage = whole.stage }); @@ -278,8 +287,8 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex .map = whole, .cursor = at, .quiet = options.quiet, - .source = add(s, Source{ .cursor = at, .stage = stage }), - .disasm = add(s, Disasm{ .cursor = at, .stage = stage }), + .source = add(s, Source{ .cursor = at, .stage = stage, .descent = options.descent }), + .disasm = if (options.descent) add(s, Descent{ .cursor = at, .stage = stage }) else add(s, Disasm{ .cursor = at, .stage = stage }), .registers = add(s, Registers{ .cursor = at, .stage = stage, .syscalls = options.syscalls, .quiet = options.quiet }), .stack = add(s, Stack{ .cursor = at, .stage = stage }), .backtrace = add(s, Backtrace{ .cursor = at, .stage = stage, .lens = options.backtrace }), @@ -344,6 +353,7 @@ test { _ = rows; _ = contexts; _ = @import("disasm.zig"); + _ = @import("descent.zig"); _ = tying; _ = @import("hexdump.zig"); _ = calls; |
