Debugging Options

All the information obtained when you use the Debugging Options listed below is coded and stored in the COBOL object file. The runtime retrieves, decodes, and sends it to the debuggers (runtime and AcuBench integrated) when requested.

-Ga This is a shortcut for turning ON all the debugging options.
-Gd This option includes the source code in the compiled object file. It also generates a single-byte no operation (NOP) instruction for each CONTINUE statement to make it easier to break at such statements when debugging.

See Runtime Debugger for more information.

-Gl       This option includes line numbers in the object file. It does not include source code in the object file. Only a mapping between addresses and line numbers is included. This allows the runtime to output line number information along with an address when a program terminates abnormally. This information also enables AcuBench to find and indicate the line of source on which the debugger is currently stopped.

If line number mapping is needed in an object to be placed in production, -Gl is the best switch to use because it results in an object file that is much smaller than those produced with -Ga.

-Gs This option includes extra symbol information. It does not include source code in the compiled object. This information is accessible only from AcuBench. The extra symbol information can be used by AcuBench to get all the children and siblings of any particular data item. It allows AcuBench to traverse the symbol table of the COBOL program and to have a tree-type control for viewing group data items.
-Gy This option includes minimal symbol information. It does not include source code in the compiled object. Instead, minimal information about names and locations is stored in the object. Using this switch, you can accept and display variables from within the debuggers.
-Gz This option restricts a program from stopping in the debugger in nearly all cases. The only time the runtime will stop and enter the debugger when executing a COBOL program compiled with -Gz is when the runtime encounters a format 2 STOP statement (STOP literal), which is meant to break into the debugger.

This option is useful if you distribute COBOL objects and allow your users to create their own COBOL programs, but you don't want them to be able to debug your programs.

This option is not compatible with any other debugger option. If other debug options are used on the command line, the last debugger option will take precedence. For example, specifying -Ga -Gz will result in an object that will never stop in the debugger, while specifying -Gz -Ga will result in an object with full debugging symbols.

This option is available only if targeting an 8.1 runtime or later. Note that specifying -Znn for any nn <= 80 will turn off a special flag that is required in order for the -Gz option to work.

Note: To debug a program in AcuBench, you need only the -Gl and -Gs options. This combination allows AcuBench to display the correct line of the correct source file when the debugger is stopped at a breakpoint and to display any data items that you want to see. It does not include the source code in the compiled object, so the object can be safely distributed without fear of unauthorized access to source code.

To perform source-level debugging with the runtime debugger, you need only the -Gd and -Gy options.

The -Ga option is helpful when you expect to use both debuggers.

See Runtime Debugger for differences between symbolic debugging and source-level debugging.