app: add support for inspect/inspect-brk in forked node process

This commit is contained in:
deepak1556 2017-06-13 00:23:11 +05:30
parent a6ea316a5d
commit 538b97582a
3 changed files with 16 additions and 1 deletions

View file

@ -6,6 +6,7 @@
#include "atom/app/uv_task_runner.h"
#include "atom/browser/javascript_environment.h"
#include "atom/browser/node_debugger.h"
#include "atom/common/api/atom_bindings.h"
#include "atom/common/crash_reporter/crash_reporter.h"
#include "atom/common/native_mate_converters/string16_converter.h"
@ -50,6 +51,10 @@ int NodeMain(int argc, char *argv[]) {
&isolate_data, gin_env.context(), argc, argv,
exec_argc, exec_argv);
// Enable support for v8 inspector.
NodeDebugger node_debugger(env);
node_debugger.Start();
mate::Dictionary process(gin_env.isolate(), env->process_object());
#if defined(OS_WIN)
process.SetMethod("log", &AtomBindings::Log);

View file

@ -9,6 +9,8 @@
#include "libplatform/libplatform.h"
#include "native_mate/dictionary.h"
#include "atom/common/node_includes.h"
namespace atom {
NodeDebugger::NodeDebugger(node::Environment* env) : env_(env) {

View file

@ -7,7 +7,15 @@
#include <memory>
#include "atom/common/node_includes.h"
#include "base/macros.h"
namespace node {
class Environment;
}
namespace v8 {
class Platform;
}
namespace atom {