To start debugging a COBOL application that is already running in a container

  1. Open the application's project in Visual COBOL.

    If you are working with one of the Docker demonstrations, they include the relevant project files.

  2. Set a breakpoint on the line where you want execution to pause when you connect to the application.
  3. Create a new debug configuration:
    1. Click Run > Debug configurations.
    2. In the left side pane of the Debug Configurations dialog box double-click COBOL Attach to Process.
    3. Change the name from New_configuration to something relevant to your application.
    4. In the COBOL Project section, specify the name of the project to be used while debugging.
    5. In the Connection Properties section:
      1. Specify the IP address of the container in the Remote Host field.
        Note: You can specify the container's ID instead of its IP address.
      2. Check Specify the port on which the cobdebugremote process will listen on the remote host.
      3. In the cobdebugremote port field, specify the port that the container is listening on. This would be 6100 for the container that would have been started by the docker run command in Running a Container that is to be Debugged.
    6. In the Debug Options section, ensure that the setting of Application is 64 bit reflects whether the application to be debugged is 32-bit or 64-bit.
  4. Click Debug.
  5. When the Select Process dialog box appears, select the application you want to the debug and wait until debugging starts.