Mohammed Keyvanzadeh
dd6eb67b1f
src: prefer data accessor of string and vector
...
The pattern of getting the address of the element at index 0 of a
container is generally used to materialize a pointer to the backing
data of a container, however `std::string` and `std::vector`
provide a `data()` accessor to retrieve the data pointer which
should be preferred.
This also ensures that in the case that the container is empty, the
data pointer access does not perform an errant memory access.
PR-URL: https://github.com/nodejs/node/pull/47750
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-05-03 14:09:23 +00:00
Rich Trott
a518e4b871
debugger: indicate server is ending
...
Currently, we say "listening" when we are ending the server. Change it
to "ending".
Fixes: https://github.com/nodejs/node/issues/39272
PR-URL: https://github.com/nodejs/node/pull/39334
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Yash Ladha <yash@yashladha.in >
2021-07-12 06:29:01 -07:00
cjihrig
921f75534c
inspector: drop 'chrome-' from inspector url
...
It has been reported that the
https://github.com/cjihrig/node-v8-inspector V8 inspector
extension can no longer connect DevTools (despite no code changes
to the extension since Feb. 2017). Upon investigation, Chrome
dropped support for the chrome-devtools: scheme recently. I've
confirmed that dropping 'chrome-' from the URL here allows the
debugger to function properly with modern Chrome.
Refs: https://chromium.googlesource.com/chromium/src/+/6700d12448f76712c62a6d2372a95b97a26d4779
PR-URL: https://github.com/nodejs/node/pull/33758
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Matheus Marchini <mat@mmarchini.me >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: David Carlier <devnexen@gmail.com >
2020-06-08 21:31:56 -04:00
dokugo
24d43ca1b1
inspector: update faviconUrl
...
PR-URL: https://github.com/nodejs/node/pull/29562
Reviewed-By: David Carlier <devnexen@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2019-10-04 05:57:20 +02:00
Aleksei Koziatinskii
f0018a5152
inspector: added --inspect-publish-uid
...
This flag specifies how inspector websocket url should be reported.
Tthre options are supported:
- stderr - reports websocket as a message to stderr,
- http - exposes /json/list endpoint that contains inspector websocket
url,
- binding - require('inspector').url().
Related discussion: https://github.com/nodejs/diagnostics/issues/303
PR-URL: https://github.com/nodejs/node/pull/27741
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2019-06-03 18:15:04 +03:00
Sam Roberts
b6bfc19378
src: remove util-inl.h from header files
...
Its intended that *-inl.h header files are only included into the src
files that call the inline methods. Explicitly include it into the files
that need it.
PR-URL: https://github.com/nodejs/node/pull/27631
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2019-05-13 13:43:26 -07:00
Ben Noordhuis
df67cd0fef
inspector: print all listening addresses
...
Some hostnames have multiple interfaces. Before this commit, the
inspector only printed the first one. Now, it prints them all.
No test. I can't think of a reliable way to test this on the CI matrix.
PR-URL: https://github.com/nodejs/node/pull/26008
Fixes: https://github.com/nodejs/node/issues/13772
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2019-03-04 02:19:27 +01:00
gengjiawen
c3d889182b
src: apply clang-tidy rule modernize-use-override
...
PR-URL: https://github.com/nodejs/node/pull/26103
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2019-02-18 05:43:22 +01:00
ZYSzys
93e0c6ae89
src: use NULL check macros to check nullptr
...
PR-URL: https://github.com/nodejs/node/pull/25916
Refs: https://github.com/nodejs/node/pull/20914
Reviewed-By: Masashi Hirano <shisama07@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
2019-02-07 07:22:38 +01:00
Eugene Ostroukhov
39977db7c0
inspector: split main thread interface from transport
...
Workers debugging will require interfacing between the "main" inspector
and per-worker isolate inspectors. This is consistent with what WS
interface does. This change is a refactoring change and does not change
the functionality.
PR-URL: https://github.com/nodejs/node/pull/21182
Fixes: https://github.com/nodejs/node/issues/21725
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-07-13 23:42:50 +02:00
GauthamBanasandra
026d279aca
inspector: use js_app.html as the landing page for chrome devtools
...
As of this commit in chromium -
https://chromium-review.googlesource.com/c/chromium/src/+/905450
a new landing page (js_app.html) has been added and inspector.html
has been made as the fallback page.
Another motivation for this patch is the following bug in
chromium -
https://bugs.chromium.org/p/chromium/issues/detail?id=846642
due to which, source maps won't get applied with inspector.html,
but works with js_app.html
In order to maintain compatibility, this patch adds a URL
"devtoolsFrontendUrlCompat" to the response of /json/list REST API
so that those using Chrome browsers older than 66.0.3345.0
could use this to open DevTools.
PR-URL: https://github.com/nodejs/node/pull/21385
Refs: https://bugs.chromium.org/p/chromium/issues/detail?id=846642
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/905450
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com >
Reviewed-By: Jan Krems <jan.krems@gmail.com >
Reviewed-By: Matheus Marchini <matheus@sthima.com >
2018-06-28 09:24:02 -03:00
Eugene Ostroukhov
327ce2dc92
inspector: code cleanup
...
Remove some unused code from the WS server implementation and switch to
smart pointers where possible.
PR-URL: https://github.com/nodejs/node/pull/21070
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2018-06-05 09:09:06 -07:00
Anna Henningsen
bd6dc9ebab
src: replace template< → template <
...
PR-URL: https://github.com/nodejs/node/pull/20675
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2018-05-14 18:09:23 +02:00
Eugene Ostroukhov
1300103534
inspector: allow concurrent inspector sessions
...
This change enables concurrent inspector sessions, through WebSocket
interface as well as JS interface, in any combination.
PR-URL: https://github.com/nodejs/node/pull/20137
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Gus Caplan <me@gus.host >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
2018-04-26 12:48:48 -07:00
Eugene Ostroukhov
71059fbfa5
inspector: Use default uv_listen backlog size
...
PR-URL: https://github.com/nodejs/node/pull/20254
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
2018-04-26 09:16:02 -07:00
Nick Filatov
f3e107aeef
src: add punctuation in --inspector doc url message
...
PR-URL: https://github.com/nodejs/node/pull/19871
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
2018-04-10 01:28:02 +02:00
Eugene Ostroukhov
a9a1f12b42
inspector: report client-visible host and port
...
Node instance may not know the real host and port user sees when
debug frontend connects through the SSH tunnel. This change fixes
'/json/list' response by using the value client provided in the host
header.
PR-URL: https://github.com/nodejs/node/pull/19664
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com >
2018-04-02 10:20:30 -07:00
Ben Noordhuis
e989cd1faf
src: fix compile warnings introduced in 73ad3f9bea
...
Fix warnings introduced in commit 73ad3f9bea ("inspector: Fix crash for
WS connection"):
* add missing `override` keywords
* remove unused fields and functions
PR-URL: https://github.com/nodejs/node/pull/17649
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
2017-12-15 07:47:11 +01:00
Eugene Ostroukhov
73ad3f9bea
inspector: Fix crash for WS connection
...
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-11 15:53:21 -08:00
Daniel Bevenius
e32bbbf4d7
src: use nullptr instead of NULL
...
PR-URL: https://github.com/nodejs/node/pull/17373
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
2017-12-01 07:45:00 +01:00
Eugene Ostroukhov
6e2c29bcab
inspector: perform DNS lookup for host
...
PR-URL: https://github.com/nodejs/node/pull/13478
Fixes: https://github.com/nodejs/node/issues/13477
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2017-06-16 09:46:36 -07:00
Sam Roberts
26ab769940
inspector: refactor to rename and comment methods
...
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-06-01 15:54:34 -07: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
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
Josh Gavant
a4125a3c49
src: remove experimental warning for inspect
...
* Removes "experimental" warning.
Fixes: https://github.com/nodejs/node/issues/11770
PR-URL: https://github.com/nodejs/node/pull/12352
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
2017-04-13 14:59:58 -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
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
Eugene Ostroukhov
ba776b3a56
inspector: no crash when WS server can't start
...
This change also changes error message to make it consistent with the
one printed by the debugger.
Fixes: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10878
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-20 09:10:37 -08:00
Eugene Ostroukhov
295bd11468
test: have inspector test pick an open port
...
This ensures that cctest can be ran concurrently with other instances of
cctest or while the node is ran with --inspect.
Ref: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10861
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-19 11:00:09 -08:00
Daniel Bevenius
6d3c5b78c8
src: reduce test_inspector_socket_server output
...
Currently, when test/cctest/test_inspector_socket_server.cc is run there
is output written to stderr by src/inspector_socket_server.cc which is
interleaved with the gtest report:
Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URLs in Chrome:
...
The goal of this commit is to remove the above logged information
by introducing an out_ member in the InspectorSocketServer class
which defaults to stderr (keeping the current behavior).
Setting out_ to NULL is supported in which case nothing will be written
and is what the test has been configured with. When working on specific
test case the appropriate output stream can be specified for the
ServerHolder constructor to limit logging to that test case.
PR-URL: https://github.com/nodejs/node/pull/10537
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-01-06 20:13:12 +01:00
Eugene Ostroukhov
3c29b2f851
inspector: fix Coverity defects
...
One defect remains - Coverity believes that a session object is never
freed while in reality its lifespan is tied to a libuv socket.
PR-URL: https://github.com/nodejs/node/pull/10240
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
2016-12-14 09:54:07 -08:00
Eugene Ostroukhov
42da740ed8
inspector: split HTTP/WS server from the inspector
...
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-12-06 14:47:49 -08:00