You can debug a running application in one of the following ways:
You can attach to and debug applications as running processes:
Select the configuration you want to use, if prompted. This creates a launch.json inside a .vscode subfolder in the folder that contains your sources. The launch.json includes two default configurations - one for launching an application, and the other one for attaching to a process. For example:
{
"type": "cobol",
"request": "attach",
"name": "COBOL (native): Attach to process",
"processId": "${command:pickProcess}"
},
For PL/I, this is respectively:
{
"type": "pli",
"request": "attach",
"name": "PL/I: Attach to process",
"processId": "${command:pickProcess}"
}
to open the Run panel.
(Start Debugging).
This opens the Attach to process widget.
This creates a launch.json inside a .vscode subfolder in the folder that contains your sources, and opens the file in the editor.
This opens a pop-up with the available configurations.
For COBOL this is:
{
"type": "COBOL",
"request": "launch",
"name": "COBOL (native): Wait for attachment",
"waitForAttachment": {options}
}
Where the supported options are:
{
"type": "COBOL",
"request": "launch",
"name": "COBOL (native): Wait for attachment",
"waitForAttachment": {
"any": {}
}
}
{
"type": "COBOL",
"request": "launch",
"name": "COBOL (native): Wait for attachment",
"waitForAttachment": {
"directory": "pathtodirectory"
}
}
{
"type": "COBOL",
"request": "launch",
"name": "COBOL (native): Wait for attachment",
"waitForAttachment": {
"id": "myid"
}
}
{
"type": "COBOL",
"request": "launch",
"name": "COBOL (native): Wait for attachment",
"waitForAttachment": {
"any": {},
"returnToWait": true
}
}
For PL/I, this adds the following:
{
"type": "pli",
"request": "launch",
"name": "PL/I: Wait for attachment",
"waitForAttachment": {
"id": "<unique-id>"
}
}
Where, for PL/I, Visual Studio Code waits for and then attaches itself to the next PL/I program which calls PLITEST with the identifier you specify in the unique-id field as an argument.
(Start Debugging).