From 4b4113a0217ee27c78e7efddb66ff5a455d49083 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 12 Nov 2026 13:19:32 -0300 Subject: debugger: add a native GUI with live V8 JIT debugging --- build/debugger.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build/debugger.zig') diff --git a/build/debugger.zig b/build/debugger.zig index f0b0e7c..af6e2e0 100644 --- a/build/debugger.zig +++ b/build/debugger.zig @@ -9,6 +9,8 @@ pub fn add(ctx: Ctx) void { // Position-independent, so the load bias is exercised. const fib = ctx.cTarget("fib", &.{"fib.c"}); fib.pie = true; + const no_lines = b.addExecutable(.{ .name = "fib-nolines", .root_module = b.createModule(.{ .target = ctx.target, .optimize = .Debug, .link_libc = true, .sanitize_c = .off }) }); + no_lines.root_module.addCSourceFile(.{ .file = b.path("targets/fib.c"), .flags = &.{ "-O0", "-g0" } }); const list = ctx.cTarget("list", &.{"list.c"}); const threads = ctx.cTarget("threads", &.{"threads.c"}); const libc_glibc = ctx.cTarget("libc-glibc", &.{"libc.c"}); @@ -51,6 +53,7 @@ pub fn add(ctx: Ctx) void { // The library, driven from Zig: the targets' paths come as options. const paths = b.addOptions(); + paths.addOptionPath("fib_nolines", no_lines.getEmittedBin()); for (targets) |t| paths.addOptionPath(b.dupe(std.mem.replaceOwned(u8, b.allocator, t.name, "-", "_") catch @panic("OOM")), t.getEmittedBin()); const lib_tests = b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("src/trace/debugger_test.zig"), @@ -174,7 +177,7 @@ pub fn add(ctx: Ctx) void { until.addArg("10"); until.expectStdErrMatch("ended at fib, as --until asked"); const until_show = b.addRunArtifact(ctx.exe); - until_show.addArgs(&.{ "show" }); + 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. -- cgit v1.3