add_tracepoint
Set a tracepoint that logs an expression each time a line is hit, without pausing program execution. Works with async methods and stores results for later retrieval.
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 |