Skip to content

Commit d8aca08

Browse files
committed
Set _debugWaitConnect on --inspect-brk
1 parent c419ebd commit d8aca08

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

atom/browser/node_debugger.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "base/command_line.h"
88
#include "base/strings/utf_string_conversions.h"
99
#include "libplatform/libplatform.h"
10+
#include "native_mate/dictionary.h"
1011

1112
namespace atom {
1213

@@ -35,6 +36,13 @@ void NodeDebugger::Start() {
3536
// with node's inspector agent
3637
platform_.reset(v8::platform::CreateDefaultPlatform());
3738

39+
// Set process._debugWaitConnect if --inspect-brk was specified to stop
40+
// the debugger on the first line
41+
if (options.wait_for_connect()) {
42+
mate::Dictionary process(env_->isolate(), env_->process_object());
43+
process.Set("_debugWaitConnect", true);
44+
}
45+
3846
inspector->Start(platform_.get(), nullptr, options);
3947
}
4048
}

atom/common/node_bindings.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,6 @@ node::Environment* NodeBindings::CreateEnvironment(
198198
PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path);
199199
process.Set("helperExecPath", helper_exec_path);
200200

201-
// Set process._debugWaitConnect if --debug-brk was specified to stop
202-
// the debugger on the first line
203-
if (browser_env_ == BROWSER &&
204-
base::CommandLine::ForCurrentProcess()->HasSwitch("debug-brk"))
205-
process.Set("_debugWaitConnect", true);
206-
207201
return env;
208202
}
209203

0 commit comments

Comments
 (0)