diff options
author | 2023-08-20 19:34:33 -0700 | |
---|---|---|
committer | 2023-08-20 19:34:33 -0700 | |
commit | 3de9ce5f30ad3a2a5615acb62a25cecdd2ddef33 (patch) | |
tree | edbfe3f14bc8f09497aeea2b88d60d9a070404f4 /src/cli.zig | |
parent | 65280853acf2385eae124ef4870af2751ad662df (diff) | |
download | bun-3de9ce5f30ad3a2a5615acb62a25cecdd2ddef33.tar.gz bun-3de9ce5f30ad3a2a5615acb62a25cecdd2ddef33.tar.zst bun-3de9ce5f30ad3a2a5615acb62a25cecdd2ddef33.zip |
Implement `--inspect-brk` (#4222)
* Implement `--inspect-brk`
* Bump WebKit
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/cli.zig')
-rw-r--r-- | src/cli.zig | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cli.zig b/src/cli.zig index 88b6aa057..0fb618afc 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -161,7 +161,8 @@ pub const Arguments = struct { clap.parseParam("--no-macros Disable macros from being executed in the bundler, transpiler and runtime") catch unreachable, clap.parseParam("--target <STR> The intended execution environment for the bundle. \"browser\", \"bun\" or \"node\"") catch unreachable, clap.parseParam("--inspect <STR>? Activate Bun's Debugger") catch unreachable, - clap.parseParam("--inspect-wait <STR>? Activate Bun's Debugger and wait for a connection before executing") catch unreachable, + clap.parseParam("--inspect-wait <STR>? Activate Bun's Debugger, wait for a connection before executing") catch unreachable, + clap.parseParam("--inspect-brk <STR>? Activate Bun's Debugger, set breakpoint on first line of code and wait") catch unreachable, clap.parseParam("<POS>... ") catch unreachable, }; @@ -530,6 +531,18 @@ pub const Arguments = struct { .path_or_port = inspect_flag, .wait_for_connection = true, } }; + } else if (args.option("--inspect-brk")) |inspect_flag| { + ctx.runtime_options.debugger = if (inspect_flag.len == 0) + Command.Debugger{ .enable = .{ + .wait_for_connection = true, + .set_breakpoint_on_first_line = true, + } } + else + Command.Debugger{ .enable = .{ + .path_or_port = inspect_flag, + .wait_for_connection = true, + .set_breakpoint_on_first_line = true, + } }; } } @@ -969,6 +982,7 @@ pub const Command = struct { enable: struct { path_or_port: []const u8 = "", wait_for_connection: bool = false, + set_breakpoint_on_first_line: bool = false, }, }; |