Skip to content

Commit 0c961a2

Browse files
Merge pull request #958 from nodejs/main
Create a new pull request by comparing changes across two branches
2 parents 85b742a + 32ce183 commit 0c961a2

4 files changed

Lines changed: 38 additions & 6 deletions

File tree

doc/api/inspector.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ session.on('inspectorNotification', (message) => console.log(message.method));
7474
// Debugger.resumed
7575
```
7676

77+
> **Caveat** Breakpoints with same-thread session is not recommended, see
78+
> [support of breakpoints][].
79+
7780
It is also possible to subscribe only to notifications with specific method:
7881

7982
#### Event: `<inspector-protocol-method>`;
@@ -98,6 +101,9 @@ session.on('Debugger.paused', ({ params }) => {
98101
// [ '/the/file/that/has/the/breakpoint.js:11:0' ]
99102
```
100103

104+
> **Caveat** Breakpoints with same-thread session is not recommended, see
105+
> [support of breakpoints][].
106+
101107
#### `session.connect()`
102108

103109
<!-- YAML
@@ -247,6 +253,9 @@ session.on('inspectorNotification', (message) => console.log(message.method));
247253
// Debugger.resumed
248254
```
249255

256+
> **Caveat** Breakpoints with same-thread session is not recommended, see
257+
> [support of breakpoints][].
258+
250259
It is also possible to subscribe only to notifications with specific method:
251260

252261
#### Event: `<inspector-protocol-method>`;
@@ -271,6 +280,9 @@ session.on('Debugger.paused', ({ params }) => {
271280
// [ '/the/file/that/has/the/breakpoint.js:11:0' ]
272281
```
273282

283+
> **Caveat** Breakpoints with same-thread session is not recommended, see
284+
> [support of breakpoints][].
285+
274286
#### `session.connect()`
275287

276288
<!-- YAML
@@ -476,10 +488,27 @@ Blocks until a client (existing or connected later) has sent
476488

477489
An exception will be thrown if there is no active inspector.
478490

491+
## Support of breakpoints
492+
493+
The Chrome DevTools Protocol [`Debugger` domain][] allows an
494+
`inspector.Session` to attach to a program and set breakpoints to step through
495+
the codes.
496+
497+
However, setting breakpoints with a same-thread `inspector.Session`, which is
498+
connected by [`session.connect()`][], should be avoided as the program being
499+
attached and paused is exactly the debugger itself. Instead, try connect to the
500+
main thread by [`session.connectToMainThread()`][] and set breakpoints in a
501+
worker thread, or connect with a [Debugger][] program over WebSocket
502+
connection.
503+
479504
[CPU Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/Profiler
480505
[Chrome DevTools Protocol Viewer]: https://chromedevtools.github.io/devtools-protocol/v8/
506+
[Debugger]: debugger.md
481507
[Heap Profiler]: https://chromedevtools.github.io/devtools-protocol/v8/HeapProfiler
482508
[`'Debugger.paused'`]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused
509+
[`Debugger` domain]: https://chromedevtools.github.io/devtools-protocol/v8/Debugger
483510
[`inspector.close()`]: #inspectorclose
484511
[`session.connect()`]: #sessionconnect
512+
[`session.connectToMainThread()`]: #sessionconnecttomainthread
485513
[security warning]: cli.md#warning-binding-inspector-to-a-public-ipport-combination-is-insecure
514+
[support of breakpoints]: #support-of-breakpoints

doc/contributing/security-release-process.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ out a better way, forward the email you receive to
124124
`oss-security@lists.openwall.com` as a CC.
125125

126126
* [ ] Post in the [nodejs-social channel][]
127-
in the OpenJS slack asking for amplication of the blog post.
127+
in the OpenJS slack asking for amplification of the blog post.
128128

129129
```text
130130
Security release pre-alert:
@@ -184,7 +184,7 @@ out a better way, forward the email you receive to
184184
```
185185

186186
* [ ] Post in the [nodejs-social channel][]
187-
in the OpenJS slack asking for amplication of the blog post.
187+
in the OpenJS slack asking for amplification of the blog post.
188188
```text
189189
Security release:
190190

test/parallel/parallel.status

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ test-worker-nearheaplimit-deadlock: PASS, FLAKY
2626
[$system==linux]
2727
# https://github.com/nodejs/node/issues/39368
2828
test-domain-error-types: PASS,FLAKY
29-
# https://github.com/nodejs/node/issues/47420
30-
test-file-write-stream4: PASS,FLAKY
3129
# https://github.com/nodejs/node/issues/43465
3230
test-http-server-request-timeouts-mixed: PASS, FLAKY
3331

tools/make-v8.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ cd deps/v8 || exit
99
find . -type d -name .git -print0 | xargs -0 rm -rf
1010
../../tools/v8/fetch_deps.py .
1111

12+
JOBS_ARG=
13+
if [ "${JOBS}" ]; then
14+
JOBS_ARG="-j ${JOBS}"
15+
fi
16+
1217
ARCH=$(arch)
1318
if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
1419
TARGET_ARCH=$ARCH
@@ -46,10 +51,10 @@ if [ "$ARCH" = "s390x" ] || [ "$ARCH" = "ppc64le" ]; then
4651
gcc --version
4752
export PKG_CONFIG_PATH=$BUILD_TOOLS/pkg-config
4853
gn gen -v "out.gn/$BUILD_ARCH_TYPE" --args="is_component_build=false is_debug=false use_goma=false goma_dir=\"None\" use_custom_libcxx=false v8_target_cpu=\"$TARGET_ARCH\" target_cpu=\"$TARGET_ARCH\" v8_enable_backtrace=true $CC_WRAPPER"
49-
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" d8 cctest inspector-test
54+
ninja -v -C "out.gn/$BUILD_ARCH_TYPE" "${JOBS_ARG}" d8 cctest inspector-test
5055
else
5156
DEPOT_TOOLS_DIR="$(cd _depot_tools && pwd)"
5257
# shellcheck disable=SC2086
5358
PATH="$DEPOT_TOOLS_DIR":$PATH tools/dev/v8gen.py "$BUILD_ARCH_TYPE" --no-goma $V8_BUILD_OPTIONS
54-
PATH="$DEPOT_TOOLS_DIR":$PATH ninja -C "out.gn/$BUILD_ARCH_TYPE/" d8 cctest inspector-test
59+
PATH="$DEPOT_TOOLS_DIR":$PATH ninja -C "out.gn/$BUILD_ARCH_TYPE/" "${JOBS_ARG}" d8 cctest inspector-test
5560
fi

0 commit comments

Comments
 (0)