Preparation for Remote Debugging
1. It is recommended to split the properties file into three separate files:
COMOPT = compiler options and all necessary settings for correct debugging
RUNOPT = only the Jopaz options that are necessary for execution
2. Link the new files correctly in your configuration files for the compile & execute environment:
In the compiling environment, change the file path for export IBM_JAVA_OPTIONS= and the file path for export JZOS_MAIN_ARGS=.
In the executing environment, change only the file path for export JZOS_MAIN_ARGS=.
In both compiling and executing environments, add the JOPAZ= variable with the path to the directory where your license file is located.
Add the $JOPAZ option to your CLASSPATH in both environment configurations.
3. Add the compiler option -d or -dx to your COMOPT in order to be able to debug this progam after compilation.
-d is used to include the debug information. An additional class file is generated to store the debug information. The resulting classes don’t include the source code. Source files must be available to the debugger during the debug session.
-dx enables extended debugger functions. This option implies -d. In addition to the standard debugging features, all the variables in the class are generated including the ones that are not used in the program. Additionally, the literal constants that are generated during the execution and not as static fields in the generated class, are created as well.
When a program is compiled with -dx, the debugger is able to query and set all items of the program Data Division including the items that are not used in the Procedure Division. The IDE allows the source code to be changed while debugging.
With -dx the debugger is able to skip statements through the jump command. The resulting classes don’t include the source code.
Source files must be available to the debugger during the debug session.
4. Recompile the source again with the updated compile environment that includes the debug compiler options described before.
5. For remote debugging, a few parameters must also be added to the RUNOPT file:
jopaz.rundebug=2
=0 – The program starts in run mode and the Remote Debugger is not active.
=1 – The program starts in run mode and the Runtime Framework listens for connections from the Remote Debugger.
=2 – The program starts in debug mode and the Runtime Framework waits for connections from the Remote Debugger.
jopaz.debug.port=9998
This property specifies the port used by the Remote Debugger.
The default value is 9999.