To start debugging a COBOL application that is already running in a container
Open the application's project in
Visual COBOL.
If you are working with one of the Docker demonstrations, they include the relevant project files.
Set a breakpoint on the line where you want execution to pause when you connect to the application.
Create a new debug configuration:
Click
Run > Debug configurations.
In the left side pane of the
Debug Configurations dialog box double-click
COBOL Attach to Process.
Change the name from
New_configuration to something relevant to your application.
In the
COBOL Project section, specify the name of the project to be used while debugging.
In the
Connection Properties section:
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.
Check
Specify the port on which the cobdebugremote process will listen on the remote host.
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.
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.
Click
Debug.
When the
Select Process dialog box appears, select the application you want to the debug and wait until debugging starts.