Set _debugWaitConnect on --inspect-brk
This commit is contained in:
parent
c419ebdd6d
commit
d8aca08da7
2 changed files with 8 additions and 6 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "libplatform/libplatform.h"
|
#include "libplatform/libplatform.h"
|
||||||
|
#include "native_mate/dictionary.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -35,6 +36,13 @@ void NodeDebugger::Start() {
|
||||||
// with node's inspector agent
|
// with node's inspector agent
|
||||||
platform_.reset(v8::platform::CreateDefaultPlatform());
|
platform_.reset(v8::platform::CreateDefaultPlatform());
|
||||||
|
|
||||||
|
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
||||||
|
// the debugger on the first line
|
||||||
|
if (options.wait_for_connect()) {
|
||||||
|
mate::Dictionary process(env_->isolate(), env_->process_object());
|
||||||
|
process.Set("_debugWaitConnect", true);
|
||||||
|
}
|
||||||
|
|
||||||
inspector->Start(platform_.get(), nullptr, options);
|
inspector->Start(platform_.get(), nullptr, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -198,12 +198,6 @@ node::Environment* NodeBindings::CreateEnvironment(
|
||||||
PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path);
|
PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path);
|
||||||
process.Set("helperExecPath", helper_exec_path);
|
process.Set("helperExecPath", helper_exec_path);
|
||||||
|
|
||||||
// Set process._debugWaitConnect if --debug-brk was specified to stop
|
|
||||||
// the debugger on the first line
|
|
||||||
if (browser_env_ == BROWSER &&
|
|
||||||
base::CommandLine::ForCurrentProcess()->HasSwitch("debug-brk"))
|
|
||||||
process.Set("_debugWaitConnect", true);
|
|
||||||
|
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue