Trace marking is a feature that enables you to silently record code executed between two points, and incorporate it in a Sequence diagram. The feature also enables you to capture the execution of multiple threads. It can be particularly useful in capturing event driven sequences (such as mouse and timer events) without any user intervention.
The recording markers are breakpoints; however, instead of stopping, the debugger behaves according to the type of marker. If the marker is denoted as a recording start point, the debugger immediately begins to trace all executed calls from that point for the breaking thread. Recording is stopped again when either the thread that is being captured terminates or the thread encounters a recording end point.
Recording markers are set in the source code editor. If you right-click on the breakpoint margin at the point to begin recording, a context menu displays:
Select the Add Start Recording Marker option, then right-click on the breakpoint margin at the point to stop recording and select the Add End Recording Marker context menu option. The markers are shown below:
When the debugger is run it continues to run the thread, recording a stack history, until either the End Recording marker is encountered or the thread terminates, unlike normal breakpoints where the debugger halts and displays the line of code.
It is useful to limit the stack depth when recording particularly high-level points in an application, as the stack frame count can result in too much information being collected. You can limit stack depth using the Sequence Diagram Recording tab on the Build Script dialog.
Running this Calendar example with the one function record marker in CRecurrenceDlg::OnInitDialog() produced the following output in the Recording History window:
Stack Auto-Capture Marker
(Native Code only.) Stack markers enable you to capture any unique stack traces that occur at a point in an application. To insert a marker at the required point in code, right-click on the line and select the Add Stack Auto Capture Marker context menu option.
Each time the debugger encounters the marker it performs a stack trace. If the stack trace is not in the recording history, it is copied. The application then continues running. Stack markers provide a quick and useful picture of where a point in an application is being called from.