From 2463e602f12f969fe085bc2114a3960411b79f87 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 15:16:02 -0300 Subject: debugger: a variable the target declares is watched; the runtime has no debug info Events from the target's ring pass a tap on their way to the sink: a variable declared there (the pass's --instr vars, the agent's ztrace_watch) joins the regions recorded at every stop. With nothing else instrumented that is names and types from the compiler, values and everything else from the debugger. The instrumentation runtime is built stripped, so stepping by line runs through its calls. --- build/llvm.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build') diff --git a/build/llvm.zig b/build/llvm.zig index 94b7501..7794ecd 100644 --- a/build/llvm.zig +++ b/build/llvm.zig @@ -10,12 +10,15 @@ pub fn add(ctx: Ctx) std.Build.LazyPath { // The runtime runs inside the target at every event: optimized whatever // mode the rest is built in. - const fast = b.createModule(.{ .root_source_file = b.path("src/trace/root.zig"), .target = ctx.target, .optimize = .ReleaseFast, .pic = true }); + // No debug info either: a debugger stepping the program by line then + // runs through the runtime's calls instead of stopping in them. + const fast = b.createModule(.{ .root_source_file = b.path("src/trace/root.zig"), .target = ctx.target, .optimize = .ReleaseFast, .pic = true, .strip = true }); const rt = b.addLibrary(.{ .name = "ztrace-rt", .root_module = b.createModule(.{ .root_source_file = b.path("src/instr/rt.zig"), .target = ctx.target, .optimize = .ReleaseFast, .pic = true, + .strip = true, .imports = &.{.{ .name = "ztrace", .module = fast }}, }) }); b.installArtifact(rt); -- cgit v1.3