0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

42 Commits

Author SHA1 Message Date
Sam Roberts
c4a61b3ee5 src: check whether inspector is doing io
Inspector start means that it exists, but doesn't mean it is listening
on a port, that only happens if it is doing I/O (i.e. has an io object).

PR-URL: https://github.com/nodejs/node/pull/13504
Fixes: https://github.com/nodejs/node/issues/13499
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-06-09 09:10:57 -07:00
Nikolai Vavilov
9991e27ac8 inspector: fix crash on exception
Fixes: https://github.com/nodejs/node/issues/13438
PR-URL: https://github.com/nodejs/node/pull/13455
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
2017-06-09 14:28:17 +03:00
Sam Roberts
aae0d4559c test: rearrange inspector headers into convention
Test guide describes a conventional layout for test headers, review
inspector tests and reorganize to follow the convention.

PR-URL: https://github.com/nodejs/node/pull/13428
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-05 12:28:37 -07:00
Eugene Ostroukhov
e6dcc3dfa9 inspector: Allows reentry when paused
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-05 08:47:43 -07:00
Daniel Bevenius
7dfeb36143 test: check inspector support in test/inspector
When configuring node --without-ssl or --without-inspector these test
will fail. The underlying issue will be:

Inspector support is not available with this Node.js build
/work/nodejs/node/out/Release/node: bad option: --inspect=0

This commit adds checks to see if inspector support is enabled and if
not skips these tests.

PR-URL: https://github.com/nodejs/node/pull/13324
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-02 08:12:08 +02:00
Refael Ackermann
45d78393a9 test: mark inspector-port-zero-cluster as flaky
Ref: https://github.com/nodejs/node/issues/13343
2017-06-01 18:22:06 -04:00
Ben Noordhuis
399cb25f62 inspector: bind to random port with --inspect=0
Allow binding to a randomly assigned port number with `--inspect=0`
or `--inspect-brk=0`.

PR-URL: https://github.com/nodejs/node/pull/5025
Refs: https://github.com/nodejs/node/issues/4419
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-05-30 12:22:02 +02:00
Refael Ackermann
16689e30ae inspector: --debug* deprecation and invalidation
PR-URL: https://github.com/nodejs/node/pull/12949
Fixes: https://github.com/nodejs/node/issues/12364
Fixes: https://github.com/nodejs/node/issues/12630
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2017-05-29 11:33:59 -04:00
Daniel Bevenius
ab28e0a86a test: skip test-bindings if inspector is disabled
If node is configured --without-inspector/--without-ssl this test will
fail with the following error:
Path: inspector/test-bindings
inspector.js:8
  throw new Error('Inspector is not available');
  ^

Error: Inspector is not available
    at inspector.js:8:9
    at NativeModule.compile (bootstrap_node.js:549:7)

This commit skips this test if the inspector is disabled.

PR-URL: https://github.com/nodejs/node/pull/13186
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-05-26 05:20:26 +02:00
Eugene Ostroukhov
60390cd7fb
inspector: JavaScript bindings for the inspector
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-23 19:45:48 +02:00
Eugene Ostroukhov
5c26378cb7 inspector: fix process._debugEnd() for inspector
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-22 11:18:31 -07:00
Eugene Ostroukhov
15e160e626 inspector: report when main context is destroyed
PR-URL: https://github.com/nodejs/node/pull/12814
Reimplements: https://github.com/nodejs/node/pull/7756
Fixes: https://github.com/nodejs/node/issues/7742
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2017-05-05 11:50:18 -07:00
Vse Mozhet Byt
8b76c3e60c test: reduce string concatenations
PR-URL: https://github.com/nodejs/node/pull/12735
Refs: https://github.com/nodejs/node/pull/12455
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-05 17:39:05 +03:00
Josh Gavant
6ade7f3601 src: update --inspect hint text
* Removes "experimental" warning.
* Prints ws://_ip_:_port_:/_uuid_ for all IDs.
* Refers to nodejs.org guide for more details.

PR-URL: https://github.com/nodejs/node/pull/11207
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <mhdawson@ibm.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2017-05-04 07:58:32 -07:00
Rich Trott
a180259e42 test,lib,doc: use function declarations
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.

PR-URL: https://github.com/nodejs/node/pull/12711
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-05-01 15:56:58 -07:00
gwer
0142276977
test: replace indexOf with includes
Start the transition to Array.prototype.includes() and
String.prototype.includes().  This commit refactors most of the
comparisons of Array.prototype.indexOf() and String.prototype.indexOf()
return values with -1 to the former methods in tests.

PR-URL: https://github.com/nodejs/node/pull/12604
Refs: https://github.com/nodejs/node/issues/12586
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-30 04:08:46 +03:00
Ben Noordhuis
e0b076a949 lib,src,test: update --debug/debug-brk comments
Overlooked in commit 47f8f74 ("src: remove support for --debug") from
earlier this month.

PR-URL: https://github.com/nodejs/node/pull/12495
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-21 10:35:06 +02:00
Rich Trott
06c29a66d4 test: remove common.fail()
common.fail() was added to paste over issues with assert.fail() function
signature. assert.fail() has been updated to accept a single argument so
common.fail() is no longer necessary.

PR-URL: https://github.com/nodejs/node/pull/12293
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-12 14:25:33 -07:00
Ali Ijaz Sheikh
a235ccd168 src,test: debug is now an alias for inspect
`node debug` is now an alias of `node inspect`. This is intended to be
a minimal change – it does not get rid of the the debugger code. That
can be done in a follow-on.

PR-URL: https://github.com/nodejs/node/pull/11441
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: joshgav - Josh Gavant <josh.gavant@outlook.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
2017-04-11 17:58:26 -07:00
Brian White
61ebfa8d1f tools: add unescaped regexp dot rule to linter
PR-URL: https://github.com/nodejs/node/pull/11834
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2017-03-29 10:53:28 +02:00
Eugene Ostroukhov
b170fb7c55 inspector: proper WS URLs when bound to 0.0.0.0
JSON target list response will now return appropriate IP address
for instances listening on 0.0.0.0.

Refs: https://github.com/nodejs/node/issues/11591
PR-URL: https://github.com/nodejs/node/pull/11755
Reviewed-By: James Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-13 10:41:51 -07:00
Daniel Bevenius
1402fef098 test: make tests pass when configured without-ssl
Currently when node is build --without-ssl and the test are run,
there are a number of failing test due to tests expecting crypto
support to be available. This commit fixes fixes the failure and
instead skips the tests that expect crypto to be available.

PR-URL: https://github.com/nodejs/node/pull/11631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-04 20:16:52 +01:00
Eugene Ostroukhov
f01fd2ae70 inspector: libuv notification on incoming message
Currently Inspector posts a V8 "task" when a message is incoming. To
make sure messages are processed even when no JS is executed (e.g. while
waiting for I/O or timer), inspector will now post a libuv request.

Fixes: https://github.com/nodejs/node/issues/11589
PR-URL: https://github.com/nodejs/node/pull/11617
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-03-03 11:38:00 -08:00
cjihrig
7dd82dd1c3 test: add common.mustNotCall()
This commit adds a mustNotCall() helper for testing. This provides
an alternative to using common.fail() as a callback, or creating
a callback function for the sole purpose of calling common.fail().

PR-URL: https://github.com/nodejs/node/pull/11152
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
2017-02-06 14:07:55 -05:00
Gibson Fahnestock
7a0e462f9f test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically.

PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2017-01-11 11:43:52 +00:00
Rich Trott
a68987c154 benchmark,lib,test: adjust for linting
Formatting changes for upcoming linter update.

PR-URL: https://github.com/nodejs/node/pull/10561
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2017-01-06 14:36:01 -08:00
Josh Gavant
6ff3b03240 src, inspector: add --inspect-brk option
add an --inspect-brk option which breaks on
first line of user script. same behavior as old
--debug-brk flag.

PR-URL: https://github.com/nodejs/node/pull/8979
Reviewed-By: Eugene Ostroukhov <eostroukhov@chromium.org>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@keybase.io>
2017-01-03 15:47:40 -08:00
Eugene Ostroukhov
2f3865d5f5 inspector: check if connected before waiting
Fixes: https://github.com/nodejs/node/issues/10093
PR-URL: https://github.com/nodejs/node/pull/10094
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-12-06 14:28:20 -08:00
Ben Noordhuis
e27f14f0b4 inspector: /json/version returns object, not array
Make /json/version return an object instead of an object wrapped in an
array.

Fixes: https://github.com/nodejs/node/issues/9760
PR-URL: https://github.com/nodejs/node/pull/9762
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-11-25 16:41:32 +01:00
Rich Trott
2486273c0e test: fix flaky test-inspector
Using `socket.destroy()` instead of `socket.end()` fixes
more-than-intermittent ECONNRESET issues on Windows.

PR-URL: https://github.com/nodejs/node/pull/9727
Fixes: https://github.com/nodejs/node/issues/8804
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
2016-11-23 10:21:48 -08:00
Rich Trott
103858e95f test: refactor inspector-helper.js
There are two instances of `setTimeout()` called without a duration in
`inspector-helper.js`. Change to `setImmediate()` for clarity that it
isn't a mistake.

PR-URL: https://github.com/nodejs/node/pull/9499
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2016-11-09 19:26:25 -08:00
Eugene Ostroukhov
a41b41a540 inspector: do not prompt to use localhost
There are multiple reports of Windows7 not being able to resolve
localhost on some setups (web search also confirms that). This change
will advertise "127.0.0.1" as inspector host name.

Fixes: https://github.com/nodejs/node/issues/9382
Fixes: https://github.com/nodejs/node/issues/9188
PR-URL: https://github.com/nodejs/node/pull/9451
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-11-07 10:10:26 -08:00
Eugene Ostroukhov
8f00455c51 inspector: switch to new inspector APIs
This implementation switches to V8 inspector from the V8 repository. The
new inspector integration is now using final APIs and exposes a stable
wire protocol, removing the need for pointing the users to specific
devtools version.

PR-URL: https://github.com/nodejs/node/pull/9028
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-26 09:37:45 -07:00
Ben Noordhuis
3d9b379cd0 inspector: fix request path nullptr dereference
Fix a nullptr dereference when an invalid path is requested.

Regression introduced in commit 69fc85d ("inspector: generate UUID for
debug targets"), caught by Coverity.

PR-URL: https://github.com/nodejs/node/pull/9184
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-10-24 23:06:43 +02:00
Eugene Ostroukhov
da184f4f33 inspector: no URLs when the debugger is connected
By convention, inspector protocol targets do not advertise connection
URLs when the frontend is already connected as multiple inspector
protocol connections are not supported.

PR-URL: https://github.com/nodejs/node/pull/8919
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-20 13:17:36 -07:00
Eugene Ostroukhov
69fc85dcb3 inspector: generate UUID for debug targets
PR-URL: https://github.com/nodejs/node-private/pull/79
Fixes: https://github.com/nodejs/security/issues/81
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-10-19 14:25:22 +11:00
Rich Trott
33dd4ec645 test: mark test-inspector flaky on windows
PR-URL: https://github.com/nodejs/node/pull/8835
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-09-29 11:56:41 -04:00
Eugene Ostroukhov
af2ca7ce06 test: use Buffer.alloc
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/8748
2016-09-26 09:27:34 -07:00
Eugene Ostroukhov
5acbeb0272 inspector: address race conditions
Stress tests uncovered 2 race conditions, when IO events happened during
V8 entering event loop on pause or during Node.js shutdown.

Fixes: nodejs/node#8669
PR-URL: https://github.com/nodejs/node/pull/8672
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
2016-09-23 11:02:32 -07:00
Teddy Katz
b1b1978ec5
tools: add additional ESLint rules
PR-URL: https://github.com/nodejs/node/pull/8643
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@keybase.io>
2016-09-20 23:21:10 -04:00
Eugene Ostroukhov
efe4d19240 inspector: report default context
Fixes: https://github.com/nodejs/node/issues/8426
PR-URL: https://github.com/nodejs/node/pull/8502
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-09-20 11:57:30 -07:00
Eugene Ostroukhov
b4a249f66b inspector: introduce a smoke test
This test executes a simple debug session over the inspector protocol.

PR-URL: https://github.com/nodejs/node/pull/8429
Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
2016-09-19 12:40:16 -07:00