diff options
author | 2023-08-20 19:34:33 -0700 | |
---|---|---|
committer | 2023-08-20 19:34:33 -0700 | |
commit | 3de9ce5f30ad3a2a5615acb62a25cecdd2ddef33 (patch) | |
tree | edbfe3f14bc8f09497aeea2b88d60d9a070404f4 /src/bun.js/javascript.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/bun.js/javascript.zig')
-rw-r--r-- | src/bun.js/javascript.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig index 98e61f3b0..07d3f64cf 100644 --- a/src/bun.js/javascript.zig +++ b/src/bun.js/javascript.zig @@ -748,6 +748,8 @@ pub const VirtualMachine = struct { next_debugger_id: u64 = 1, poll_ref: JSC.PollRef = .{}, wait_for_connection: bool = false, + set_breakpoint_on_first_line: bool = false, + const debug = Output.scoped(.DEBUGGER, false); extern "C" fn Bun__createJSDebugger(*JSC.JSGlobalObject) u32; @@ -784,6 +786,8 @@ pub const VirtualMachine = struct { Bun__ensureDebugger(debugger.script_execution_context_id, debugger.wait_for_connection); while (debugger.wait_for_connection) { this.eventLoop().tick(); + if (debugger.wait_for_connection) + this.eventLoop().autoTickActive(); } } @@ -1136,6 +1140,7 @@ pub const VirtualMachine = struct { this.debugger = Debugger{ .path_or_port = debugger.enable.path_or_port, .wait_for_connection = debugger.enable.wait_for_connection, + .set_breakpoint_on_first_line = debugger.enable.set_breakpoint_on_first_line, }; }, } @@ -1870,6 +1875,7 @@ pub const VirtualMachine = struct { pub fn reloadEntryPoint(this: *VirtualMachine, entry_path: []const u8) !*JSInternalPromise { this.has_loaded = false; this.main = entry_path; + this.main_hash = bun.JSC.Watcher.getHash(entry_path); try this.entry_point.generate( this.allocator, |