I'm trying to debug a Fortran program using Visual Studio Code (VSC) under Mac OS X Catalina (10.15.3). I can set a breakpoint and VSC breaks at that line appropriately, but I can't Watch any variables. VSC displays "error: no value" in the Watch window and when I type print <variable_name> in the terminal. I'm using the lldb debugger.
Here are the extensions I've installed
C/C++ Fortran Breakpoint Support FORTRAN IntelliSense Modern Fortran Python Jupyter Native Debug
This is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/test",
"args": ["${workspaceFolder}/data.txt"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"osx": {
"MIMode": "lldb",
}
}
]
}
and my tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make",
"args": [],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
Has anyone successfully used a debugger for a Fortran program in VS Code? I can debug a C++ program with no issues.