Debugging Generated Code Programs

When you run a program as generated code and the COBOL system traps a protection violation, the run-time system gives an RTS error and identifies the program in which the error occurred, together with a reference to the native code instruction that caused the error. The run-time system also gives a reference to the COBOL source line which caused the failure. To match the native code instruction reference to the COBOL source line which caused the error, you need to compile with the Compiler directives SOURCEASM and ASM. Specifying these directives causes the Compiler to create a .grp file which contains an assembler listing for your program, showing the relationship between COBOL program lines and native instructions.

To eliminate an RTS error use the Run operation of the debugger to run the program until the error occurs, and when control is passed back to the debugger you can identify the line causing the error.