TPC-C Source or Disassembly Level Debugging
On this Page
TPC-C Source or Disassembly Level Debugging¶
If the TPC kernel was compiled with debug information, specifying -g
flag in the tpc-clang
command line, debug information will be available for the debugger. In this case, the default debugging mode
will be source level debugging.
If the TPC kernel was not compiled with debug information, then only disassembly level debugging will be available.
TPC-C Source Level Debugging Mode¶
The Source View displays the TPC source code and the line number corresponding to the current instruction address is marked.
When setting a breakpoint on a source line, see Breakpoint set/unset, a breakpoint will be set on that line if some TPC instruction in the kernel is flagged to be the start of that source line according to the debug information. If the start of the source line is not flagged, a breakpoint will be set on the next line number in the same source file if the above conditions are met.
Pressing the “Step-Over” button will cause the kernel to continue execution until a kernel instruction which is the first instruction of a source line.
TPC-C level variables and their current value will be displayed under the “Variables” node in Variables View.
Disassembly Level Debugging Mode¶
The Source View displays the disassembly of the executing kernel and the next kernel instruction to be executed is marked.
When setting a breakpoint, see Breakpoint set/unset, a breakpoint will be set on that line or the first line after that line which is a start of a new kernel instruction.
Pressing on the “Step-Over” button will cause the kernel to continue execution until the next kernel instruction.
Switching Between Source Level and Disassembly Debugging Modes¶
When both TPC-C source level and disassembly debug level modes are available for the compiled kernel, toggling between the two modes can be done by right clicking the Source View and choosing the “Toggle Disassemble” button.
Source Level Debugging Limitations¶
The quality of the debug information depends on the optimization level the kernel was compiled with. To debug a specific object at source level, it is recommended to build with -O0 or -O1 compilation switches. This enables more accurate debug information by adding nops to avoid pipeline issues. Building with -O2 compilation switch creates more compact and efficient code, at the price of lower quality debug information.