Debugger
Overview
isCOBOL provides a visual source-level debugger. In order to debug programs, they must be compiled with either -d option or -dx option. For example:
iscc -d Options SourceCode
When one of the two options is used, the compiler stores the names of the source file, the copyfile, and their respective paths in the class file. The source file is not included in the resulting class file (it contains only references to the source code). The Debugger must be able to load these names and paths in order to show its content.
When the Debugger loads a program, it looks for the source and copy files in the following paths:
Paths stored in the class file, looking for relative paths in the current working directory.
Paths stored in the class file, looking for relative paths in the paths of the iscobol.debug.code_prefix property.
Basename of paths stored in the class file, looking in the paths listed in the iscobol.debug.code_prefix property.
Paths stored in the class file, looking for relative paths in the paths of the CLASSPATH environment variable.
Basename of paths stored in the class file, looking in the paths listed in the CLASSPATH environment variable.
That's why the original source must be available at debugging time. This is especially handy when the Remote Debugger is used.
The following command starts a debugging session of the ProgramName program.
iscrun -d ProgramName
When running on Windows, the following command can also be used:
isrun -d ProgramName
Note - The Debugger takes advantage of some Compiler features, therefore the isCOBOL Compiler must be installed and licensed on the machine where the above commands are used.
Debugging a multi-thread program
When the debugged program generates more threads, it’s possible to switch from one thread to another by choosing the desired thread at the bottom of the Run menu.
While the debugger is waiting for user input, all threads are blocked. When the debugger gives the control to the program, all threads run.