- From the TraceBuilder menu, select Instrument Code.
- Select a group for your traces or define a new one by typing the name
into the Trace Group field.
- Type a name format for your traces.
The default is {$CN}_{$FN}, which means
className_functionName
.
The values for className
and functionName
are parsed from the source code.
- Type a text format for your traces.
The default is {$cn}::{$fn}, which means
className::functionName
.
The values for className
and functionName
are parsed from the source code.
- (Optional) From the Templates list, you can select pre-defined
format for the trace.
For example, Function entry-exit template parses the name
of the class and function where the cursor is currently located.
An entry trace is added to the beginning of the function and the exit trace
is added to the end.
- (Optional) Select any of the following options, as needed:
- Add "this" pointer parameter to add this pointer to the
instrumented traces.
- Add function parameters to add function parameters to the instrumented
traces.
- Add exit traces to add exit trace to every function instrumented.
Note: this option is selected only if the Function Entry-Exit template
is selected.
- Add return value to exit traces to add a function return value
to every function that is instrumented.
- Click OK.
- In the displayed dialog, select the functions you want to instrument.
- Click OK to start instrumentation of the source code.