diff options
Diffstat (limited to 'anim/src/root.zig')
| -rw-r--r-- | anim/src/root.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig index 60ae6dc..b7be9b4 100644 --- a/anim/src/root.zig +++ b/anim/src/root.zig @@ -42,6 +42,7 @@ pub const contextLegend = contexts.legend; pub const disasm = @import("disasm.zig"); pub const Disasm = disasm.Disasm; pub const Descent = @import("descent.zig").Descent; +pub const graph = @import("graph.zig"); pub const calls = @import("calls.zig"); pub const CallTree = calls.Tree; pub const Nodes = @import("nodes.zig").Nodes; @@ -246,6 +247,10 @@ pub const Context = struct { /// callee's window under the call row, and a system call the /// kernel's under the `syscall` (step with `descent.step`). descent: bool = false, + /// On the map the disassembly as the function's graph (`graph.Map`), + /// two columns wide beside the source, the registers and the stack + /// in the last column. + graph: bool = false, }; /// The ties between the panes, drawn over everything added before. @@ -284,11 +289,11 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex 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. - const whole = s.new(map.Map{ .stage = Stage.init(s, map.split(at.rec, options.split.band.h > 0, .{ at.first, at.last })), .frame = stage, .t = s.value(map.diving.land + map.diving.still), .cursor = at }); + 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.descent) whole.add(s, Descent{ .cursor = at, .stage = whole.stage }) else whole.add(s, Disasm{ .cursor = at, .stage = whole.stage }); + 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 }); // The stack goes on in the rest of the memory's column, from where its own column ends. @@ -367,6 +372,7 @@ test { _ = contexts; _ = @import("disasm.zig"); _ = @import("descent.zig"); + _ = graph; _ = tying; _ = @import("hexdump.zig"); _ = calls; |
