Skip to Content

Is there currently a way to debug COBOL and Java source together?

Estimated Reading Time: 1 Minutes

Question: I'd like to be able to step debug through COBOL source into a call to Java and have a Java debugger pop-up or attach and allow me to step through the Java source.
How can I currently do that?

Also, is there a way to step from a Java debugger into the COBOL source and have the isCOBOL debugger take over?

Answer:
To run a COBOL program in debug when it called from Java, do the following:

  1. Compile the program you want to debug with a -d or -dx switch
  2. Set this variable in your isCOBOL properties file:
       iscobol.rundebug=2
    
    You can also set this variable if you want to specify the debug port:
       iscobol.debug.port=[port number]
    

  3. Start the remote debugger. Open a separate command prompt window, go to your program folder and type
       iscrun -d -r  
    
    A connect window will open and repeatedly try to connect to an isCOBOL program compiled for debug.

  4. Start your program. If you are calling COBOL from Java, you can start your Java and debug it as normal.
    When the Java calls your COBOL program, it will open in the debugger.
    Switch to the isCOBOL Debugger window to debug the COBOL code.
NOTE:
This method of remote debugging of your COBOL code will work with C programs that call isCOBOL programs as well as Java.

Is there currently a way to debug COBOL and Java source together?