Starting the debugger automatically using just-in-time debugging

You can trigger debugging when Eclipse is not running using the just-in-time debugging feature. When this is enabled, an application stops when a run-time error occurs or if the code contains CBL_DEBUGBREAK and CBL_DEBUG_START library routines, and Eclipse starts in the debugging perspective.

The debugger attaches to the failed process and the relevant line of source is highlighted. You can view the contents of data items and memory and step through the code using the standard debugging techniques.

By default, when just-in-time debugging launches Eclipse, only the source file is opened and no associated project. This means that there are no background parse errors or warnings shown, and editing the source is impossible. However, in UNIX environments you can configure Eclipse to open in a particular workspace, so that you can see the file in the context of a project and use background parsing and other editing features.

To enable just-in-time debugging on CBL_DEBUGBREAK or CBL_DEBUG_START

Windows:
  1. Open Eclipse and click Window > Preferences > Micro Focus > COBOL > Debug.
  2. Select Enable JIT debugging.
UNIX:
  1. Use the COBJIT_ECLIPSE environment variable to ensure the Eclipse IDE is launched when the CBL_DEBUGBREAK or CBL_DEBUG_START statement is executed:
    COBJIT_ECLIPSE=true <workspace to open on error>

To enable just-in-time debugging when a run-time error occurs

  1. Perform the same steps as for CBL_DEBUGBREAK or CBL_DEBUG_START calls.
  2. Set the debug_on_error run-time tunable. See the section Run-time Tunables for instructions on how to do this.