Debugging Files in Open Folder Mode

Note: In Open Folder mode, you can only debug individual COBOL sources, .int, .gnt, .exe or .dll files.

You can start debugging without compiling the files first in which case Visual Studio will attempt to compile the startup file.

Alternatively, you can compile the files first and specify any debug settings such as a start program, a working directory or any command line arguments.

Compile your source files

Make sure that you compile any source files that are part of the debug session in advance. This is because Visual Studio does not compile them automatically.

You can debug any binary files without compiling them first.

Specifying debug settings

To specify debug settings:

  1. Right-click a source file in Solution Explorer and click Debug and Launch Settings.
  2. Specify any debug options as required:
    Start Program
    Set this to the .int file for single-output applications and to a source file for multi-output applications.

    For multi-source applications, set this to the program that runs.

    Working Directory
    Command Line Arguments

Visual Studio stores any specific debug configuration settings in the launch.vs.json file inside the .vs subfolder.

You can start debugging without specifying any properties first or compiling. If no .idy file is available inside the source files folder, Visual Studio searches for .idy files in the locations specified Tools > Options > Standalone Editing > Program Symbols (.IDY).

Specifying a startup file

To specify that a file is the startup file:

  1. Right-click a source file in Solution Explorer and click Set as Startup Item.

    You can select a COBOL file or an .int, .gnt, .exe or an .obj file as the startup item.

    If specified, when debugging Visual Studio starts the file specified as a Start Program in the Debug Options dialog box (Debug and Launch Settings), over the one set as a startup file.

Start debugging

To start debugging a file:

  1. Right-click a source file in Solution Explorer and click Debug.

    Visual Studio checks the date of the compiled program. If it is older than the source code or if it does not exist, Visual Studio compiles the program first.

    If Visual Studio does not find the compiled program, it prompts you to locate it.

  2. Debug the program in the usual way.