Debugging compiled applications
You can use a symbolic debugger to debug applications compiled with IBM® Open XL C/C++.
At compile time, you can use the -g option to instruct the IBM Open XL C/C++ compiler to include debugging information in compiled output. For -g, you can also use different levels to balance between debug capability and compiler optimization.
You can then use dbx or any symbolic debugger that supports the AIX® XCOFF executable format to step through and inspect the behavior of your compiled application.
Optimized applications pose special challenges when you debug your applications. If you need to debug an optimized application, you can consider using the -gN form of the -g option along with any optimization options. This form of the -g option provides different levels of tradeoff between full optimization and full debugging support, depending on the value of N.
-gN can be -g0, -g1, or -g2 only.
| Scenario | In stabstring format | In dwarf format |
|---|---|---|
| For C cases | Supported | Supported |
| For C++ cases | For complicated virtual functions, dbx may not able to execute with command call or print. | ibm-clang++_r supports basic debug functionality while dbx limitations might be encountered for newer C++ features which dbx does not support. |