Joyee Cheung
a79e224eb2
debugger: add edit-free runtime expression probes to node inspect
...
Add a non-interactive probe mode to `node inspect` for inspecting
runtime values in a run-to-completion application. This allows
users to perform printf-style debugging without having to modify
the application code and clean up afterwards, it also supports
structured output to be consumed by tools.
Probe mode launches the application, sets one or more source
breakpoints, evaluates one expression at each hit, and prints a
single text or JSON report when execution ends.
Interface:
node inspect [--json] [--preview] [--timeout=<ms>] [--port=<port>]
--probe <file>:<line>[:<col>] --expr <expr> ...
[--] <script> [args...]
Example:
```js
// cli.js
let maxRSS = 0;
for (let i = 0; i < 2; i++) {
const { rss } = process.memoryUsage();
maxRSS = Math.max(maxRSS, rss);
}
```
```
$ node inspect --probe cli.js:5 --expr 'rss' cli.js
Hit 1 at cli.js:5
rss = 54935552
Hit 2 at cli.js:5
rss = 55083008
Completed
```
(Prettified JSON to fit in commit message restrictions).
```js
$ node inspect --json --probe cli.js:5 --expr 'rss' cli.js
{"v":1,"probes":[{"expr":"rss","target":["cli.js",5]}],
"results":[
{"probe":0,"event":"hit","hit":1,
"result":{"type":"number","value":55443456,
"description":"55443456"}},
{"probe":0,"event":"hit","hit":2,
"result":{"type":"number","value":55574528,
"description":"55574528"}},
{"event":"completed"}]}
```
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/62713
Reviewed-By: Jan Martin <jan.krems@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
2026-04-19 15:59:10 +00:00
..
2026-04-19 01:05:38 +00:00
2026-04-02 14:15:43 +00:00
2026-04-09 16:48:25 +00:00
2026-03-03 14:09:06 +00:00
2026-03-28 20:53:57 +00:00
2026-03-06 16:44:34 +00:00
2026-02-26 00:48:26 +00:00
2026-02-27 18:36:59 +00:00
2026-03-27 21:50:58 +00:00
2026-04-11 19:24:50 +00:00
2026-03-27 21:50:58 +00:00
2026-03-27 21:50:58 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-04-14 19:20:13 +00:00
2026-03-01 11:33:00 +00:00
2026-03-17 16:53:37 +01:00
2026-04-16 06:31:35 +00:00
2026-03-06 14:41:39 +00:00
2026-04-16 06:31:35 +00:00
2026-03-17 16:03:31 +00:00
2026-04-16 06:31:35 +00:00
2026-03-28 05:24:34 +00:00
2026-03-29 11:56:01 +00:00
2026-03-29 14:35:10 +00:00
2026-03-29 14:35:10 +00:00
2026-04-12 05:39:39 +00:00
2026-03-31 08:09:36 +00:00
2026-03-28 05:24:34 +00:00
2026-03-28 05:24:34 +00:00
2026-03-26 10:31:26 +01:00
2026-04-09 08:10:14 +02:00
2026-03-30 21:35:58 +02:00
2026-03-31 19:57:34 +00:00
2026-03-26 10:31:26 +01:00
2026-03-26 10:31:26 +01:00
2026-03-26 10:31:26 +01:00
2026-04-05 10:12:21 +00:00
2026-04-09 08:10:14 +02:00
2026-03-11 18:43:14 +00:00
2026-03-30 04:52:33 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-04-19 15:59:10 +00:00
2026-02-27 01:23:58 +00:00
2026-03-30 04:52:33 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-02-25 06:00:03 +00:00
2026-03-31 19:04:24 +00:00
2026-03-31 19:04:24 +00:00
2026-03-17 11:54:48 +00:00
2026-03-31 19:04:24 +00:00
2026-03-17 11:54:48 +00:00
2026-03-14 22:43:11 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-04-07 19:51:49 +02:00
2026-03-29 14:53:52 +00:00
2026-03-05 19:32:54 +00:00
2026-04-14 10:44:30 +01:00
2026-03-10 14:11:23 +00:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-31 20:51:44 +00:00
2026-04-14 22:09:32 +00:00
2026-04-14 22:09:32 +00:00
2026-04-14 22:09:32 +00:00
2026-04-09 04:24:41 +00:00
2026-03-31 20:51:44 +00:00
2026-04-07 20:26:47 +00:00
2026-04-10 22:06:36 +00:00
2026-02-14 15:11:22 +00:00
2026-02-21 22:58:52 +00:00
2026-02-21 22:58:52 +00:00
2026-02-21 22:58:52 +00:00
2026-02-21 22:58:52 +00:00
2026-03-24 19:47:20 -03:00
2026-03-02 19:10:56 +00:00
2026-03-02 12:49:30 +00:00
2026-02-13 18:21:04 +01:00
2026-03-24 19:47:07 -03:00
2026-03-24 19:47:07 -03:00
2026-04-04 19:37:53 +00:00
2026-02-22 01:06:33 +01:00
2026-03-06 06:01:21 +00:00
2026-04-04 19:37:53 +00:00
2026-02-16 08:26:48 +00:00
2026-04-04 09:24:22 +00:00
2026-02-13 18:21:04 +01:00
2026-04-13 12:03:07 +02:00
2026-04-06 08:18:14 +00:00
2026-03-01 11:33:00 +00:00
2026-03-31 03:35:31 +00:00
2026-02-27 16:32:43 +00:00
2026-04-03 10:25:26 +00:00
2026-03-01 11:33:00 +00:00
2026-03-15 23:46:53 +00:00
2026-02-27 16:32:43 +00:00
2026-04-07 01:38:13 +00:00
2026-03-06 14:41:39 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-04-16 06:31:35 +00:00
2026-02-26 00:48:26 +00:00
2026-04-14 10:44:30 +01:00
2026-03-24 19:47:00 -03:00
2026-04-14 10:44:30 +01:00
2026-04-14 10:44:30 +01:00
2026-03-01 11:33:00 +00:00
2026-04-14 10:44:30 +01:00
2026-04-14 10:44:30 +01:00
2026-04-09 07:10:44 -07:00
2026-04-09 07:10:35 -07:00
2026-04-09 07:10:35 -07:00
2026-04-09 07:10:35 -07:00
2026-04-09 07:10:33 -07:00
2026-03-31 09:19:44 -07:00
2026-03-31 09:19:44 -07:00
2026-04-13 09:59:14 +00:00
2026-04-09 07:10:35 -07:00
2026-03-19 14:41:50 +01:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-02-22 01:32:53 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-09 21:20:08 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-06 15:38:36 +00:00
2026-03-12 16:35:31 +00:00
2026-03-02 18:28:25 +00:00
2026-04-17 15:37:44 +00:00
2026-02-26 21:36:23 +00:00
2026-04-02 16:55:11 +00:00
2026-04-16 06:31:35 +00:00
2026-04-13 15:01:34 +03:00
2026-03-18 17:09:42 +00:00
2026-02-26 15:37:55 +00:00
2026-04-16 06:31:35 +00:00
2026-04-01 10:09:41 +00:00
2026-03-22 13:07:26 +00:00
2026-03-27 15:52:13 +00:00
2026-04-02 16:55:11 +00:00
2026-03-02 23:04:06 +00:00
2026-04-02 16:55:11 +00:00
2026-04-01 11:29:56 +00:00
2026-04-18 10:10:56 +00:00
2026-02-24 23:37:22 +00:00
2026-02-26 15:37:55 +00:00
2026-03-03 20:35:35 +00:00
2026-02-27 19:00:28 +00:00
2026-04-10 20:40:01 +00:00
2026-03-02 23:29:14 +00:00
2026-02-27 16:16:21 +00:00
2026-02-22 00:19:40 +00:00
2026-04-10 11:13:34 +02:00
2026-03-17 13:38:50 +00:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-04-06 09:59:56 -07:00
2026-04-06 09:59:56 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-04-06 09:59:56 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-03-27 19:55:17 -07:00
2026-04-06 09:59:56 -07:00
2026-04-06 09:59:56 -07:00
2026-03-18 06:04:26 +00:00
2026-04-17 01:46:10 +00:00
2026-04-17 11:29:42 +00:00
2026-04-10 13:29:46 +00:00
2026-03-26 13:02:48 +00:00
2026-02-28 11:22:35 +00:00
2026-03-26 13:02:48 +00:00
2026-03-06 14:41:39 +00:00
2026-03-06 14:41:39 +00:00
2026-04-10 13:29:46 +00:00
2026-03-24 19:46:55 -03:00
2026-03-26 13:02:48 +00:00
2026-03-26 13:02:48 +00:00
2026-03-26 13:02:48 +00:00
2026-03-01 11:33:00 +00:00
2026-03-24 19:46:50 -03:00
2026-03-08 18:32:29 +00:00
2026-03-08 18:32:29 +00:00
2026-04-17 12:38:50 +00:00
2026-02-27 16:32:43 +00:00
2026-04-09 15:01:51 -04:00
2026-03-17 07:57:07 +00:00
2026-04-18 20:04:06 +00:00
2026-02-24 19:30:35 +00:00
2026-04-09 14:26:14 +00:00
2026-04-18 08:27:24 +00:00
2026-04-16 19:53:24 +00:00
2026-03-11 18:43:14 +00:00
2026-03-26 22:04:32 +01:00
2026-03-26 22:04:32 +01:00
2026-03-16 22:04:01 +01:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-03-26 10:31:26 +01:00
2026-03-26 10:31:26 +01:00
2026-03-31 19:57:34 +00:00
2026-03-26 10:31:26 +01:00
2026-03-06 10:39:51 +00:00
2026-03-14 12:52:23 +00:00
2026-03-19 14:41:50 +01:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-04-17 07:47:49 +00:00
2026-03-16 22:04:01 +01:00
2026-03-11 18:23:21 +00:00
2026-04-17 07:47:49 +00:00
2026-03-19 14:41:50 +01:00
2026-03-06 22:08:56 +00:00
2026-04-13 15:42:29 +00:00
2026-03-06 22:08:57 +00:00
2026-03-02 23:15:09 +00:00
2026-03-06 22:08:56 +00:00
2026-04-10 20:39:49 +00:00
2026-03-04 16:02:27 +00:00
2026-03-02 23:15:09 +00:00
2026-02-13 16:30:09 +00:00
2026-04-09 14:26:14 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-03-01 11:33:00 +00:00
2026-03-26 22:18:32 +00:00