From aeed5f9ebd02b376411f3ee82dd3222f9c3b6e85 Mon Sep 17 00:00:00 2001 From: mlugg Date: Sat, 24 May 2025 22:25:17 +0100 Subject: compiler: introduce incremental debug server In a compiler built with debug extensions, pass `--debug-incremental` to spawn the "incremental debug server". This is a TCP server exposing a REPL which allows querying a bunch of compiler state, some of which is stored only when that flag is passed. Eventually, this will probably move into `std.zig.Server`/`std.zig.Client`, but this is easier to work with right now. The easiest way to interact with the server is `telnet`. --- lib/std/Build/Step/Compile.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/std/Build/Step/Compile.zig') diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 066167905d..7e8b782932 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -1447,6 +1447,10 @@ fn getZigArgs(compile: *Compile, fuzz: bool) ![][]const u8 { try zig_args.append("--debug-compile-errors"); } + if (b.debug_incremental) { + try zig_args.append("--debug-incremental"); + } + if (b.verbose_cimport) try zig_args.append("--verbose-cimport"); if (b.verbose_air) try zig_args.append("--verbose-air"); if (b.verbose_llvm_ir) |path| try zig_args.append(b.fmt("--verbose-llvm-ir={s}", .{path})); -- cgit v1.2.3