Tracepoints
Tracepoints are breakpoints associated with user-specified actions that allow you to set automatic debug logging when a particular source code location executes. Tracepoints can be used to alter the execution flow.
Tracepoints help you answer the following questions during a debugging session:
- Which function does my program execute?
- What values does my variable have at a specific source location?
- What is my current call stack, thread ID, and so on at a specific source location?
- How did the value of my variable change over time at a specific source location?
You can add a custom message when a breakpoint is hit using the Print Message option in the Edit Breakpoint dialog box. The message displays in the Debug Output window. The debugger evaluates the following special keywords and replaces them in the tracepoint message with their corresponding value:
- $FUNCTION: Gets the name of the current function.
- $CALLER: Gets the name of the caller function.
- $PID: Gets the value of the current process ID, represented as decimal integer.
- $PNAME: Gets the name of the current process image.
- $TID: Gets the value of the current thread ID, represented as decimal integer.
- $CALLSTACK: Gets the current call stack of the current frame.
- $TIMESTAMP: Gets the current time stamp.
- $LINE: Gets the value of the current source code line in the current file, represented as decimal integer.
- $FILE: Gets the name of the current source code file.
You can also write expressions between curly brackets and the debugger evaluates the expression and replaces the {expression} construct with the corresponding result, if the evaluation succeeds. An error message appears if the evaluation does not succeed.
![]() |
Note To escape special characters like "$", "{", and "}", insert "\" before the character. |
You can redirect execution when a breakpoint is hit by enabling the Set Next Line option in the Edit Breakpoint dialog box and selecting the desired line to execute. To resume execution after a breakpoint is hit, enable the Continue Execution option.