| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6210528 commit 7d4f038
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -415,6 +415,11 @@ parser.add_option('--no-browser-globals', | |||
| 415 | 415 | help='do not export browser globals like setTimeout, console, etc. ' + | |
| 416 | 416 | '(This mode is not officially supported for regular applications)') | |
| 417 | 417 | ||
| 418 | + parser.add_option('--without-inspector', | ||
| 419 | + action='store_true', | ||
| 420 | + dest='without_inspector', | ||
| 421 | + help='disable experimental V8 inspector support') | ||
| 422 | + | ||
| 418 | 423 | (options, args) = parser.parse_args() | |
| 419 | 424 | ||
| 420 | 425 | # Expand ~ in the install prefix now, it gets written to multiple files. | |
@@ -810,6 +815,7 @@ def configure_node(o): | |||
| 810 | 815 | o['variables']['library_files'] = options.linked_module | |
| 811 | 816 | ||
| 812 | 817 | o['variables']['asan'] = int(options.enable_asan or 0) | |
| 818 | + o['variables']['v8_inspector'] = b(not options.without_inspector) | ||
| 813 | 819 | ||
| 814 | 820 | if options.use_xcode and options.use_ninja: | |
| 815 | 821 | raise Exception('--xcode and --ninja cannot be used together.') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -179,4 +179,18 @@ process or via URI reference to the listening debugger: | |||
| 179 | 179 | * `node debug <URI>` - Connects to the process via the URI such as | |
| 180 | 180 | localhost:5858 | |
| 181 | 181 | ||
| 182 | + ## V8 Inspector Integration for Node.js | ||
| 183 | + | ||
| 184 | + __NOTE: This is an experimental feature.__ | ||
| 185 | + | ||
| 186 | + V8 Inspector integration allows attaching Chrome DevTools to Node.js | ||
| 187 | + instances for debugging and profiling. | ||
| 188 | + | ||
| 189 | + V8 Inspector can be enabled by passing the `--inspect` flag when starting a | ||
| 190 | + Node.js application. It is also possible to supply a custom port with that flag, | ||
| 191 | + e.g. `--inspect=9222` will accept DevTools connections on port 9222. | ||
| 192 | + | ||
| 193 | + To break on the first line of the application code, provide the `--debug-brk` | ||
| 194 | + flag in addition to `--inspect`. | ||
| 195 | + | ||
| 182 | 196 | [TCP-based protocol]: https://github.com/v8/v8/wiki/Debugging-Protocol | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -81,6 +81,10 @@ | |||
| 81 | 81 | // Start the debugger agent | |
| 82 | 82 | NativeModule.require('_debugger').start(); | |
| 83 | 83 | ||
| 84 | + } else if (process.argv[1] == '--remote_debugging_server') { | ||
| 85 | + // Start the debugging server | ||
| 86 | + NativeModule.require('internal/inspector/remote_debugging_server'); | ||
| 87 | + | ||
| 84 | 88 | } else if (process.argv[1] == '--debug-agent') { | |
| 85 | 89 | // Start the debugger agent | |
| 86 | 90 | NativeModule.require('_debug_agent').start(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -250,6 +250,28 @@ | |||
| 250 | 250 | 'deps/v8/src/third_party/vtune/v8vtune.gyp:v8_vtune' | |
| 251 | 251 | ], | |
| 252 | 252 | }], | |
| 253 | + [ 'v8_inspector=="true"', { | ||
| 254 | + 'defines': [ | ||
| 255 | + 'HAVE_INSPECTOR=1', | ||
| 256 | + 'V8_INSPECTOR_USE_STL=1', | ||
| 257 | + ], | ||
| 258 | + 'sources': [ | ||
| 259 | + 'src/inspector_agent.cc', | ||
| 260 | + 'src/inspector_socket.cc', | ||
| 261 | + 'src/inspector_socket.h', | ||
| 262 | + 'src/inspector-agent.h', | ||
| 263 | + ], | ||
| 264 | + 'dependencies': [ | ||
| 265 | + 'deps/v8_inspector/v8_inspector.gyp:v8_inspector', | ||
| 266 | + ], | ||
| 267 | + 'include_dirs': [ | ||
| 268 | + 'deps/v8_inspector', | ||
| 269 | + 'deps/v8_inspector/deps/wtf', # temporary | ||
| 270 | + '<(SHARED_INTERMEDIATE_DIR)/blink', # for inspector | ||
| 271 | + ], | ||
| 272 | + }, { | ||
| 273 | + 'defines': [ 'HAVE_INSPECTOR=0' ] | ||
| 274 | + }], | ||
| 253 | 275 | [ 'node_use_openssl=="true"', { | |
| 254 | 276 | 'defines': [ 'HAVE_OPENSSL=1' ], | |
| 255 | 277 | 'sources': [ | |
@@ -690,7 +712,10 @@ | |||
| 690 | 712 | 'target_name': 'cctest', | |
| 691 | 713 | 'type': 'executable', | |
| 692 | 714 | 'dependencies': [ | |
| 715 | + 'deps/openssl/openssl.gyp:openssl', | ||
| 716 | + 'deps/http_parser/http_parser.gyp:http_parser', | ||
| 693 | 717 | 'deps/gtest/gtest.gyp:gtest', | |
| 718 | + 'deps/uv/uv.gyp:libuv', | ||
| 694 | 719 | 'deps/v8/tools/gyp/v8.gyp:v8', | |
| 695 | 720 | 'deps/v8/tools/gyp/v8.gyp:v8_libplatform' | |
| 696 | 721 | ], | |
@@ -711,6 +736,20 @@ | |||
| 711 | 736 | 'sources': [ | |
| 712 | 737 | 'test/cctest/util.cc', | |
| 713 | 738 | ], | |
| 739 | + | ||
| 740 | + 'conditions': [ | ||
| 741 | + ['v8_inspector=="true"', { | ||
| 742 | + 'dependencies': [ | ||
| 743 | + 'deps/openssl/openssl.gyp:openssl', | ||
| 744 | + 'deps/http_parser/http_parser.gyp:http_parser', | ||
| 745 | + 'deps/uv/uv.gyp:libuv' | ||
| 746 | + ], | ||
| 747 | + 'sources': [ | ||
| 748 | + 'src/inspector_socket.cc', | ||
| 749 | + 'test/cctest/test_inspector_socket.cc' | ||
| 750 | + ] | ||
| 751 | + }] | ||
| 752 | + ] | ||
| 714 | 753 | } | |
| 715 | 754 | ], # end targets | |
| 716 | 755 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -225,6 +225,9 @@ inline Environment::Environment(v8::Local<v8::Context> context, | |||
| 225 | 225 | makecallback_cntr_(0), | |
| 226 | 226 | async_wrap_uid_(0), | |
| 227 | 227 | debugger_agent_(this), | |
| 228 | + #if HAVE_INSPECTOR | ||
| 229 | + inspector_agent_(this), | ||
| 230 | + #endif | ||
| 228 | 231 | http_parser_buffer_(nullptr), | |
| 229 | 232 | context_(context->GetIsolate(), context) { | |
| 230 | 233 | // We'll be creating new objects so make sure we've entered the context. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,9 @@ | |||
| 5 | 5 | ||
| 6 | 6 | #include "ares.h" | |
| 7 | 7 | #include "debug-agent.h" | |
| 8 | + #if HAVE_INSPECTOR | ||
| 9 | + #include "inspector_agent.h" | ||
| 10 | + #endif | ||
| 8 | 11 | #include "handle_wrap.h" | |
| 9 | 12 | #include "req-wrap.h" | |
| 10 | 13 | #include "tree.h" | |
@@ -549,6 +552,12 @@ class Environment { | |||
| 549 | 552 | return &debugger_agent_; | |
| 550 | 553 | } | |
| 551 | 554 | ||
| 555 | + #if HAVE_INSPECTOR | ||
| 556 | + inline inspector::Agent* inspector_agent() { | ||
| 557 | + return &inspector_agent_; | ||
| 558 | + } | ||
| 559 | + #endif | ||
| 560 | + | ||
| 552 | 561 | typedef ListHead<HandleWrap, &HandleWrap::handle_wrap_queue_> HandleWrapQueue; | |
| 553 | 562 | typedef ListHead<ReqWrap<uv_req_t>, &ReqWrap<uv_req_t>::req_wrap_queue_> | |
| 554 | 563 | ReqWrapQueue; | |
@@ -586,6 +595,9 @@ class Environment { | |||
| 586 | 595 | size_t makecallback_cntr_; | |
| 587 | 596 | int64_t async_wrap_uid_; | |
| 588 | 597 | debugger::Agent debugger_agent_; | |
| 598 | + #if HAVE_INSPECTOR | ||
| 599 | + inspector::Agent inspector_agent_; | ||
| 600 | + #endif | ||
| 589 | 601 | ||
| 590 | 602 | HandleWrapQueue handle_wrap_queue_; | |
| 591 | 603 | ReqWrapQueue req_wrap_queue_; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments