diff --git a/doc/api/debugger.md b/doc/api/debugger.md index c7490af82924..04db8523ed73 100644 --- a/doc/api/debugger.md +++ b/doc/api/debugger.md @@ -237,6 +237,11 @@ added: - v26.1.0 - v24.16.0 changes: + - version: REPLACEME + pr-url: https://github.com/nodejs/node/pull/67201 + description: Add `--pid ` and `--host `/`--port ` to probe a process that's + already running. The report now includes a top-level `target` field to describe what was + probed, and a `locations` field showing which probe is bound to which location. - version: - v26.6.0 - v24.20.0 @@ -270,8 +275,10 @@ changes: `node inspect` supports a non-interactive probe mode for inspecting runtime values in an application via the flag `--probe`. -Currently, probe mode only supports launching a new process from the entry point -script specified on the command line. +There are two ways to use probe mode: + +* Launch a new process and probe it by specifying the entry point script. +* Attach to and probe a running process using `--pid ` or `--host `/`--port `. The probe mode sets one or more source breakpoints, evaluates specified expressions whenever the execution reaches a breakpoint, and prints one @@ -281,10 +288,18 @@ printf-style debugging without having to modify the application code and clean up afterwards. It also supports structured JSON output for tool use. ```console +# To launch a new process and probe it: $ node inspect --probe :[:] --expr [--cond ] [--max-hit ] [--probe :[:] --expr [--cond ] [--max-hit ] ...] [--json] [--preview] [--timeout=] [--port=] [--] [ ...]