From aefde257db6e7cf683b923498c0d471885ab67a9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 12 Nov 2026 01:40:04 -0300 Subject: record: --until ends the recording at a place The ASan scene cut its run by a count of steps, which moves with the compiler; --until __asan_report_store1 ends it where the report begins. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- build/debugger.zig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'build/debugger.zig') diff --git a/build/debugger.zig b/build/debugger.zig index e50c82c..f0b0e7c 100644 --- a/build/debugger.zig +++ b/build/debugger.zig @@ -165,6 +165,22 @@ pub fn add(ctx: Ctx) void { // The 64 are counted from fib, whatever the loader did before. from_show.expectStdOutMatch(" 64 step\n"); step.dependOn(&from_show.step); + // From main, by instruction, to fib: --until ends the recording there. + const until = b.addRunArtifact(ctx.exe); + until.addArgs(&.{ "record", "--from", "main", "--until", "fib", "-o" }); + const until_recording = until.addOutputFileArg("until.ztrace"); + until.addArg("--"); + until.addArtifactArg(fib); + until.addArg("10"); + until.expectStdErrMatch("ended at fib, as --until asked"); + const until_show = b.addRunArtifact(ctx.exe); + until_show.addArgs(&.{ "show" }); + until_show.addFileArg(until_recording); + until_show.addArg("-1"); + // WHERE resolves as -b's does: a function's place past its prologue. + until_show.expectStdOutMatch("rip "); + until_show.expectStdOutMatch(" (fib+"); + step.dependOn(&until_show.step); // ... and by syscall: the loader's own are passed, not taken for the place. const from_sys = b.addRunArtifact(ctx.exe); from_sys.addArgs(&.{ "record", "--by", "syscall", "--from", "fib", "-o" }); -- cgit v1.3