PowerAda Preparing a Program to Use the Debugger

From OC Systems Wiki!
Jump to: navigation, search

Compile all Ada compilation units you want to debug without the -k option. The -k option causes the compiler not to store special debugging information in your working sublibrary and not to keep some intermediate code forms that are normally deleted. Both types of information are required to debug an Ada unit. The debugger can examine objects, such as a library unit, only if you compile that library unit without the -k option. Although you can compile a secondary unit, such as a package body, without -k and debug it without having debugger information for the corresponding library unit, objects declared in the library unit and used in the secondary unit are not visible.

For best results, the code should be generated at the lowest level of optimization by omitting the -O option.

Compile any C or C++ source files you want to debug with the -g option to include debugging information. The PowerAda debugger can work with the XCOFF stab strings that this option creates. If you link in assembler code with this information, the debugger uses it too, although most of the inter-language debugging that this book discusses is for C.