add_tracepoint
Set a non-stopping tracepoint that logs expression values on each hit without pausing the program. Handles async methods by tracking adjusted source lines.
Instructions
Set a non-stopping tracepoint that logs expression values.
State: Works in any state. The tracepoint fires automatically on each hit.
The tracepoint evaluates the expression each time the line is hit, without visibly pausing the program. Results are stored in a trace buffer accessible via get_trace_log.
Async state machines: when the target line is inside an async method, the
C# compiler moves the first executable instruction to the line after the
await. netcoredbg reports the adjusted line via DAP, and netcoredbg-mcp
tracks both the user-requested and adjusted lines — tracepoint matching
works for both. No user action required; get_trace_log will contain entries
and the program will NOT pause.
Args: file: Source file path line: Line number (1-based) expression: Expression to evaluate on each hit
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | ||
| line | Yes | ||
| expression | Yes |