From fd18b656a3bf4518f08105fe5c2c297dc0a1224f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 20 Dec 2016 18:01:28 +0100 Subject: [PATCH] lib: build `node inspect` into `node` Include the relevant files from `deps/node-inspect` in the compiled `node` binary and make `node inspect` work like `node-inspect`. PR-URL: https://github.com/nodejs/node/pull/10187 Reviewed-By: James M Snell --- lib/internal/bootstrap_node.js | 4 ++++ node.gyp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index efdbc5d9e3ac48..366a99e5628b9b 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -76,6 +76,10 @@ // Start the debugger agent NativeModule.require('_debugger').start(); + } else if (process.argv[1] === 'inspect') { + // Start the debugger agent + NativeModule.require('node-inspect/lib/_inspect').start(); + } else if (process.argv[1] === '--remote_debugging_server') { // Start the debugging server NativeModule.require('internal/inspector/remote_debugging_server'); diff --git a/node.gyp b/node.gyp index b70ae25e0653ae..e3f8aa83af0bf7 100644 --- a/node.gyp +++ b/node.gyp @@ -113,6 +113,9 @@ 'deps/v8/tools/tickprocessor.js', 'deps/v8/tools/SourceMap.js', 'deps/v8/tools/tickprocessor-driver.js', + 'deps/node-inspect/lib/_inspect.js', + 'deps/node-inspect/lib/internal/inspect_client.js', + 'deps/node-inspect/lib/internal/inspect_repl.js', ], 'conditions': [ [ 'node_shared=="true"', {