debugger: expose v8debug
This commit is contained in:
parent
73f4aa1113
commit
7b5a1b06ba
2 changed files with 8 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "atom/browser/javascript_environment.h"
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "gin/array_buffer.h"
|
||||
#include "gin/v8_initializer.h"
|
||||
|
||||
|
@ -20,6 +21,12 @@ JavascriptEnvironment::JavascriptEnvironment()
|
|||
}
|
||||
|
||||
bool JavascriptEnvironment::Initialize() {
|
||||
auto cmd = base::CommandLine::ForCurrentProcess();
|
||||
if (cmd->HasSwitch("debug-brk")) {
|
||||
// Need to be called before v8::Initialize().
|
||||
const char expose_debug_as[] = "--expose_debug_as=v8debug";
|
||||
v8::V8::SetFlagsFromString(expose_debug_as, sizeof(expose_debug_as) - 1);
|
||||
}
|
||||
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
|
||||
gin::ArrayBufferAllocator::SharedInstance());
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue