Just-In-Time Debugging

You can use Visual Studio Code as the just-in-time (JIT) debugger in the following scenarios:

JIT debugging support has the following requirements:

To register Visual Studio Code as the JIT debugger:

On Windows:

By default, the Micro Focus COBOL product installed on your machine is the default JIT debugger for COBOL applications. You need to register Visual Studio Code as the JIT debugger on your machine as shown below if you want to use it for JIT debugging.

  1. Navigate to the bin\debugadapter\win-x86 subfolder in the installation location of Micro Focus COBOL. By default, this is: C:\Users\<userid>\.vscode\extensions\microfocus.mfcodetools-<version>.
  2. Run the MicroFocus.VSCodeJIT executable with the /r (register) argument:
    MicroFocus.VSCodeJIT.exe /r

    This replaces the value specified by the main COBOL product installation to use either Eclipse or Visual Studio as debugger.

To restore the original value of the JIT debugger for COBOL, repeat these steps but use the /u argument (unregister) to unregister the Visual Studio Code JIT debugger.

In addition, if you have either Visual COBOL for Eclipse or Enterprise Developer for Eclipse installed, you must disable the Enable JIT debugging setting from Preferences > Micro Focus > COBOL > Debug.

On Linux:

On Linux, you need to create a COBOL run-time configuration file with the location of the Visual Studio Code JIT debugger, and set the COBCONFIG environment variable to that file. This ensures that Visual Studio Code will be launched for just-in-time debugging and not the Character Animator available with your Micro Focus COBOL product.

  1. Create a run-time configuration file that contains the following line:
    set debugger_command="<extension-folder>/bin/debugadapter/linux-x64/MicroFocus.VSCodeJIT"

    By default, the location of the extension folder is: ~/.vscode/extensions/microfocus.mfcodetools-<version>.

  2. Set the COBCONFIG environment variable to the configuration file - follow the links below for instructions.