summaryrefslogtreecommitdiff
path: root/src/cli/dbg.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-10 13:36:32 -0300
committerGabriel Schneider <[email protected]>2026-11-10 14:12:08 -0300
commit02aa51a6f54235cf18e627dbbfe21f21e502eb0b (patch)
treea53416bdf0e5bb0ce80da63176fe13393c502a2c /src/cli/dbg.zig
parent16895292becf82f493aaced2b10f889bad436156 (diff)
downloadcomputeranim-02aa51a6f54235cf18e627dbbfe21f21e502eb0b.tar.gz
computeranim-02aa51a6f54235cf18e627dbbfe21f21e502eb0b.zip
context: disassembly, telescopes and names in every stop; strings as one table
For a viewer to show what pwndbg's context shows, the debugger records it while the memory is there: each register and the top of the stack followed as pointers three deep (--telescope), every code address met named, eight instructions from the pc disassembled by capstone (built from source for x86, into the command only; pinned as in 03-codenomicom). zt.telescope reads a chain back with the kind of memory each link points into, and ztrace show prints the context, coloured on a terminal as pwndbg colours. The thirty thousand strings of a small run showed that a string map in each keyframe costs 700 bytes of tree a string: strings are now one table for the recording, appended a batch and read whole at open. fib(12) by instruction with everything on: 9 MB, 71 000 moments/s.
Diffstat (limited to 'src/cli/dbg.zig')
-rw-r--r--src/cli/dbg.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cli/dbg.zig b/src/cli/dbg.zig
index 02cebbc..e59c40a 100644
--- a/src/cli/dbg.zig
+++ b/src/cli/dbg.zig
@@ -3,6 +3,7 @@
const std = @import("std");
const zt = @import("ztrace");
const util = @import("util.zig");
+const disasm = @import("disasm.zig");
const fail = util.fail;
const Moment = zt.store.Moment;
@@ -82,6 +83,8 @@ pub fn run(init: std.process.Init, args: []const [:0]const u8) !void {
try zt.Debugger.spawn(init.gpa, init.io, try util.resolve(init, args[i]), try util.targetArgv(arena, args[i..]), if (produced) |p| p.envp.ptr else init.minimal.environ.block.slice.ptr, sink);
defer s.d.deinit();
if (produced) |p| s.d.ring = p.ring;
+ s.d.disasm = disasm.one;
+ s.d.telescope = 3;
defer s.stop_payload.deinit(init.gpa);
s.d.stack_watch = stack_bytes;
if (capture) |n| s.d.capture = n;