Commit 141de35
debugger: add --help to
- Add `--help` / `-h` to `node inspect` covering both interactive and
non-interactive probe modes. The help text is printed when
`--help`/`-h` appears before any positional argument to avoid
hijacking `--help` passed to a child script.
- Improve the documentation of probe mode and add examples, explain
same-location probe coalescing, TDZ caveat for let/const bindings,
basename matching and exit code behavior. Also move it to a
section parallel to interactive mode. Remove recommendation of
evaluating structured expressions as that is prone to missing
info in JSON mode.
Drive-by: When probe mode exits due to invalid arguments, exit with
`kInvalidCommandLineArgument` (9) instead of `kGenericUserError` (1).
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #63201
Reviewed-By: Jan Martin <jan.krems@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>node inspect and improve docs1 parent d8475e1 commit 141de35Copy full SHA for 141de35
8 files changed
+460-217Lines changed: 460 additions & 217 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib/internal/debugger
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+253-134Lines changed: 253 additions & 134 deletions
- Display the source diff
- Display the rich diff
Large diffs are not rendered by default.
Collapse file
lib/internal/debugger/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect.js+71-6Lines changed: 71 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27 | 27 | |
28 | 28 | |
29 | 29 | |
30 | | - |
| 30 | + |
31 | 31 | |
32 | 32 | |
33 | | - |
| 33 | + |
| 34 | + |
34 | 35 | |
35 | 36 | |
36 | 37 | |
| ||
39 | 40 | |
40 | 41 | |
41 | 42 | |
| 43 | + |
42 | 44 | |
43 | 45 | |
44 | 46 | |
| ||
220 | 222 | |
221 | 223 | |
222 | 224 | |
223 | | - |
| 225 | + |
224 | 226 | |
225 | 227 | |
226 | 228 | |
| ||
264 | 266 | |
265 | 267 | |
266 | 268 | |
| 269 | + |
| 270 | + |
| 271 | + |
| 272 | + |
| 273 | + |
| 274 | + |
| 275 | + |
| 276 | + |
| 277 | + |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | + |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
| 308 | + |
| 309 | + |
| 310 | + |
| 311 | + |
| 312 | + |
| 313 | + |
| 314 | + |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | + |
267 | 319 | |
268 | 320 | |
269 | 321 | |
270 | 322 | |
271 | 323 | |
272 | 324 | |
273 | | - |
| 325 | + |
274 | 326 | |
275 | 327 | |
276 | | - |
| 328 | + |
| 329 | + |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
| 335 | + |
| 336 | + |
| 337 | + |
| 338 | + |
| 339 | + |
| 340 | + |
| 341 | + |
277 | 342 | |
278 | 343 | |
279 | 344 | |
280 | | - |
| 345 | + |
281 | 346 | |
282 | 347 | |
283 | 348 | |
|
Collapse file
lib/internal/debugger/inspect_helpers.js
Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect_helpers.js+60-14Lines changed: 60 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
61 | 61 | |
62 | 62 | |
63 | 63 | |
64 | | - |
| 64 | + |
| 65 | + |
| 66 | + |
65 | 67 | |
66 | | - |
| 68 | + |
67 | 69 | |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
79 | 125 | |
80 | 126 | |
81 | 127 | |
| ||
128 | 174 | |
129 | 175 | |
130 | 176 | |
131 | | - |
| 177 | + |
132 | 178 | |
Collapse file
lib/internal/debugger/inspect_probe.js
Copy file name to clipboardExpand all lines: lib/internal/debugger/inspect_probe.js+3-61Lines changed: 3 additions & 61 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
27 | 26 | |
28 | 27 | |
29 | 28 | |
30 | 29 | |
31 | 30 | |
32 | 31 | |
33 | | - |
34 | 32 | |
35 | 33 | |
36 | 34 | |
| ||
46 | 44 | |
47 | 45 | |
48 | 46 | |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | 47 | |
61 | 48 | |
62 | 49 | |
| ||
274 | 261 | |
275 | 262 | |
276 | 263 | |
277 | | - |
278 | | - |
279 | | - |
280 | | - |
281 | | - |
282 | | - |
283 | | - |
284 | | - |
285 | | - |
286 | | - |
287 | | - |
288 | | - |
289 | | - |
290 | | - |
291 | | - |
292 | | - |
293 | | - |
294 | | - |
295 | | - |
296 | | - |
297 | | - |
298 | | - |
299 | | - |
| 264 | + |
300 | 265 | |
301 | 266 | |
302 | 267 | |
| ||
307 | 272 | |
308 | 273 | |
309 | 274 | |
310 | | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | | - |
316 | | - |
317 | | - |
318 | 275 | |
319 | 276 | |
320 | 277 | |
| ||
764 | 721 | |
765 | 722 | |
766 | 723 | |
767 | | - |
768 | | - |
769 | | - |
770 | | - |
771 | | - |
772 | | - |
773 | | - |
774 | | - |
775 | | - |
776 | | - |
777 | | - |
778 | | - |
779 | | - |
780 | | - |
781 | | - |
782 | | - |
783 | 724 | |
784 | | - |
| 725 | + |
| 726 | + |
785 | 727 | |
Collapse file
test/parallel/test-debugger-inspect-help-forwarding.mjs
Copy file name to clipboard+34Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
Collapse file
test/parallel/test-debugger-inspect-help.js
Copy file name to clipboard+37Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
Collapse file
test/parallel/test-debugger-probe-missing-expr.js
Copy file name to clipboardExpand all lines: test/parallel/test-debugger-probe-missing-expr.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
13 | 13 | |
14 | 14 | |
15 | 15 | |
16 | | - |
| 16 | + |
17 | 17 | |
18 | 18 | |
19 | 19 | |
0 commit comments