aboutsummaryrefslogtreecommitdiff
path: root/src/inspector_agent.h
AgeCommit message (Collapse)Author
2018-01-02src: remove duplicate words in commentsTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/17939 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-23vm: allow modifying context name in inspectorTimothy Gu
The `auxData` field is not exposed to JavaScript, as DevTools uses it for its `isDefault` parameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, when `Target` domain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion. PR-URL: https://github.com/nodejs/node/pull/17720 Refs: https://github.com/nodejs/node/pull/14231#issuecomment-315924067 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-12-11inspector: Fix crash for WS connectionEugene Ostroukhov
Attaching WS session will now include a roundtrip onto the main thread to make sure there is no other session (e.g. JS bindings) This change also required refactoring WS socket implementation to better support scenarios like this. Fixes: https://github.com/nodejs/node/issues/16852 PR-URL: https://github.com/nodejs/node/pull/17085 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-12-09src: fix missing handlescope bug in inspectorBen Noordhuis
Fix a regression that was introduced in commit 5886e204f0 ("inspector: track async stacks when necessary") and that I overlooked during review: the persistent handle with the callback must be rematerialized *after* the `v8::HandleScope` is created, not before. Apparently `test/sequential/test-inspector-async-call-stack.js` has no test coverage for this scenario and I'm out of good ideas on how to create a concise and reliable test case. Fixes: https://github.com/nodejs/node/issues/17496 PR-URL: https://github.com/nodejs/node/pull/17539 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-11-06inspector: include node_platform.h headerAlexey Kuzmin
Include the header instead of using a forward declaration. PR-URL: https://github.com/nodejs/node/pull/16677 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2017-10-29inspector: track async stacks when necessaryAli Ijaz Sheikh
With this change, we do async stack tracking only when explicitly requested by the inspector client. This avoids unnecessary overhead for clients that might not be interested in async stack traces. PR-URL: https://github.com/nodejs/node/pull/16308 Fixes: https://github.com/nodejs/node/issues/16180 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-10-13inspector: Move JS API code to separate fileEugene Ostroukhov
PR-URL: https://github.com/nodejs/node/pull/16056 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-08-17src: Node implementation of v8::PlatformMatt Loring
Node.js currently uses the V8 implementation of the DefaultPlatform which schedules VM tasks on a V8 managed thread pool. Since the Node.js event loop is not aware of these tasks, the Node.js process may exit while there are outstanding VM tasks. This will become problematic once asynchronous wasm compilation lands in V8. This PR introduces a Node.js specific implementation of the v8::Platform on top of libuv so that the event loop is aware of outstanding VM tasks. PR-URL: https://github.com/nodejs/node/pull/14001 Fixes: https://github.com/nodejs/node/issues/3665 Fixes: https://github.com/nodejs/node/issues/8496 Fixes: https://github.com/nodejs/node/issues/12980 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2017-08-17inspector: enable async stack tracesMiroslav Bajtoš
Implement a special async_hooks listener that forwards information about async tasks to V8Inspector asyncTask* API, thus enabling DevTools feature "async stack traces". The feature is enabled only on 64bit platforms due to a technical limitation of V8 Inspector: inspector uses a pointer as a task id, while async_hooks use 64bit numbers as ids. To avoid performance penalty of async_hooks when not debugging, the new listener is enabled only when the process enters a debug mode: - When the process is started with `--inspect` or `--inspect-brk`, the listener is enabled immediately and async stack traces lead all the way to the first tick of the event loop. - When the debug mode is enabled via SIGUSR1 or `_debugProcess()`, the listener is enabled together with the debugger. As a result, only async operations started after the signal was received will be correctly observed and reported to V8 Inspector. For example, a `setInterval()` called in the first tick of the event will not be shown in the async stack trace when the callback is invoked. This behaviour is consistent with Chrome DevTools. Last but not least, this commit fixes handling of InspectorAgent's internal property `enabled_` to ensure it's set back to `false` after the debugger is deactivated (typically via `process._debugEnd()`). Fixes: https://github.com/nodejs/node/issues/11370 PR-URL: https://github.com/nodejs/node/pull/13870 Reviewed-by: Timothy Gu <timothygu99@gmail.com> Reviewed-by: Anna Henningsen <anna@addaleax.net>
2017-08-11inspector: support extra contextsEugene Ostroukhov
This enables inspector support for contexts created using the vm module. PR-URL: https://github.com/nodejs/node/pull/14465 Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-06-06inspector: allow --inspect=host:port from jsSam Roberts
PR-URL: https://github.com/nodejs/node/pull/13228 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-05inspector: Allows reentry when pausedEugene Ostroukhov
This change allows reentering the message dispatch loop when the Node is paused. This is necessary when the pause happened as a result of the message sent by a debug frontend, such as evaluating a function with a breakpoint inside. Fixes: https://github.com/nodejs/node/issues/13320 PR-URL: https://github.com/nodejs/node/pull/13350 Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-01inspector: refactor to rename and comment methodsSam Roberts
Pure refactor, makes no functional changes but the renaming helped me see more clearly what the relationship was between methods and variables. * Renamed methods to reduce number of slightly different names for the same thing ("thread" vs "io thread", etc.). * Added comments where it was useful to me. PR-URL: https://github.com/nodejs/node/pull/13321 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-05-26inspector: add missing virtual destructorEugene Ostroukhov
This fixes a resource leak detected by a Coverity scan. PR-URL: https://github.com/nodejs/node/pull/13198 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
2017-05-23inspector: JavaScript bindings for the inspectorEugene Ostroukhov
PR-URL: https://github.com/nodejs/node/pull/12263 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Josh Gavant <josh.gavant@outlook.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-05-22inspector: fix process._debugEnd() for inspectorEugene Ostroukhov
This change ensures that the WebSocket server can be stopped (and restarted if needed) buy calling process._debugEnd. PR-URL: https://github.com/nodejs/node/pull/12777 Fixes: https://github.com/nodejs/node/issues/12559 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-04inspector: do not add 'inspector' propertyEugene Ostroukhov
'inspector' property is not an official API and should not be published on process object, where the user may discover it. This change was extracted from https://github.com/nodejs/node/pull/12263 that will be focused on creating JS bindings. PR-URL: https://github.com/nodejs/node/pull/12656 Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-04-24inspector: remove AgentImplEugene Ostroukhov
AgentImpl was introduce so inspector-agent.h does not leak libuv and inspector implementation details. Inspector had been reworked since and new classes provide this isolation and AgentImpl became unnecessary level of indirection. This change removes that class to streamline the code. PR-URL: https://github.com/nodejs/node/pull/12576 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-04-06debug: activate inspector with _debugProcessEugene Ostroukhov
This pull request switches the signal handler to start inspector socket server instead of the legacy V8 debug protocol. PR-URL: https://github.com/nodejs/node/pull/11431 Fixes: https://github.com/nodejs/node/issues/8464 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-30inspector: use inspector API for "break on start"Eugene Ostroukhov
This change removes a need for using deprecated debug context for breaking at the start of the main module. PR-URL: https://github.com/nodejs/node/pull/12076 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-12-09inspector: move options parsingEugene Ostroukhov
As inspector functionality expands, more options will need to be added. Currently this requires changing adding function arguments, etc. This change packs the veriables into a single class that can be extended without changing APIs. PR-URL: https://github.com/nodejs/node/pull/9691 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-12-06inspector: split HTTP/WS server from the inspectorEugene Ostroukhov
Both our team experiments and some embedder request indicate a potential in implementing alternative transport for inspector - e.g. IPC pipes or custom embedder APIs. This change moves all HTTP specific code into a separate class and is a first attempt at defining a boundary between the inspector agent and transport. This API will be refined as new transports are implemented. Note that even without considering alternative transports, this change enables better testing of the HTTP server (Valgrind made it possible to identify and fix some existing memory leaks). PR-URL: https://github.com/nodejs/node/pull/9630 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-09-02inspector: use script name for target titleEugene Ostroukhov
Changes inspector integration to use Node.js script file name as target title (reported in JSON and shown in developer tools UIs). It will also report file:// URL for the script as some tools seem to use that field to open the script in the editor. PR-URL: https://github.com/nodejs/node/pull/8243 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-08-15inspector: add support for uncaught exceptionAleksei Koziatinskii
To output exception in DevTools console method exceptionThrown should be called on uncaught exception on V8Inspector object. Additionally we need to wait disconnect to provide user way to inspect exception. PR-URL: https://github.com/nodejs/node/pull/8043 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
2016-07-29inspector: Do not crash if the port is n/aEugene Ostroukhov
Node process will no longer terminate with an assertion if the inspector port is not available. PR-URL: https://github.com/nodejs/node/pull/7874 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
2016-06-10inspector: reduce implementation in headerEugene Ostroukhov
This is needed to reduce the coupling between node files that use node::Environment and inspector class. Fixes: https://github.com/nodejs/node/issues/7080 PR-URL: https://github.com/nodejs/node/pull/7228 Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-05-30src,lib: v8-inspector supportPavel Feldman
This change introduces experimental v8-inspector support. This brings the DevTools debug protocol allowing Node.js to be debugged with Chrome DevTools native, or through other debuggers supporting that protocol. Partial WebSocket support, to the extent required by DevTools, is included. This is derived from the implementation in Blink. v8-inspector support can be disabled by the --without-inspector configure flag. PR-URL: https://github.com/nodejs/node/pull/6792 Reviewed-By: jasnell - James M Snell <jasnell@gmail.com> Reviewed-By: addaleax - Anna Henningsen <anna@addaleax.net> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>