Use our debugger implementation in Node
This commit is contained in:
parent
e7791a5486
commit
573c959a75
2 changed files with 9 additions and 15 deletions
|
@ -5,15 +5,18 @@
|
||||||
#include "atom/app/node_main.h"
|
#include "atom/app/node_main.h"
|
||||||
|
|
||||||
#include "atom/browser/javascript_environment.h"
|
#include "atom/browser/javascript_environment.h"
|
||||||
|
#include "atom/browser/node_debugger.h"
|
||||||
|
#include "atom/common/node_includes.h"
|
||||||
|
#include "base/command_line.h"
|
||||||
#include "gin/array_buffer.h"
|
#include "gin/array_buffer.h"
|
||||||
#include "gin/public/isolate_holder.h"
|
#include "gin/public/isolate_holder.h"
|
||||||
#include "gin/v8_initializer.h"
|
#include "gin/v8_initializer.h"
|
||||||
|
|
||||||
#include "atom/common/node_includes.h"
|
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
int NodeMain(int argc, char *argv[]) {
|
int NodeMain(int argc, char *argv[]) {
|
||||||
|
base::CommandLine::Init(argc, argv);
|
||||||
|
|
||||||
argv = uv_setup_args(argc, argv);
|
argv = uv_setup_args(argc, argv);
|
||||||
int exec_argc;
|
int exec_argc;
|
||||||
const char** exec_argv;
|
const char** exec_argv;
|
||||||
|
@ -31,17 +34,13 @@ int NodeMain(int argc, char *argv[]) {
|
||||||
gin_env.isolate(), uv_default_loop(), gin_env.context(), argc, argv,
|
gin_env.isolate(), uv_default_loop(), gin_env.context(), argc, argv,
|
||||||
exec_argc, exec_argv);
|
exec_argc, exec_argv);
|
||||||
|
|
||||||
// Start debugger.
|
// Start our custom debugger implementation.
|
||||||
node::node_isolate = gin_env.isolate();
|
NodeDebugger node_debugger(gin_env.isolate());
|
||||||
if (node::use_debug_agent)
|
if (node_debugger.IsRunning())
|
||||||
node::StartDebug(env, node::debug_wait_connect);
|
env->AssignToContext(v8::Debug::GetDebugContext());
|
||||||
|
|
||||||
node::LoadEnvironment(env);
|
node::LoadEnvironment(env);
|
||||||
|
|
||||||
// Enable debugger.
|
|
||||||
if (node::use_debug_agent)
|
|
||||||
node::EnableDebug(env);
|
|
||||||
|
|
||||||
bool more;
|
bool more;
|
||||||
do {
|
do {
|
||||||
more = uv_run(env->event_loop(), UV_RUN_ONCE);
|
more = uv_run(env->event_loop(), UV_RUN_ONCE);
|
||||||
|
|
|
@ -137,11 +137,6 @@ void NodeBindings::Initialize() {
|
||||||
AtomCommandLine::InitializeFromCommandLine();
|
AtomCommandLine::InitializeFromCommandLine();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Parse the debug args.
|
|
||||||
auto args = AtomCommandLine::argv();
|
|
||||||
for (const std::string& arg : args)
|
|
||||||
node::ParseDebugOpt(arg.c_str());
|
|
||||||
|
|
||||||
// Init node.
|
// Init node.
|
||||||
// (we assume node::Init would not modify the parameters under embedded mode).
|
// (we assume node::Init would not modify the parameters under embedded mode).
|
||||||
node::Init(nullptr, nullptr, nullptr, nullptr);
|
node::Init(nullptr, nullptr, nullptr, nullptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue