fir*_*l.1 5 debugging fortran gdb gfortran visual-studio-code
我正在尝试在 Visual Studio 代码(ubuntu 18.04)上调试 fortran 文件。
我安装了以下扩展
我的launch.json文件如下
"version": "0.0.1",
"configurations": [
{
"name": "Fortran Launch (GDB)",
"type": "cppdbg",
"request": "launch",
"targetArchitecture": "x86",
"program": "${workspaceRoot}/./a.out",
"miDebuggerPath": "gdb",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": true,
"preLaunchTask": "gfortran"
}
]
Run Code Online (Sandbox Code Playgroud)
因为我使用的是 linux,所以我不需要给出 gfortran 的路径。我还尝试通过更改.exe为 linux 扩展来稍微更改 launch.json 。我已经在问题中更新了它。但是调试器仍然没有运行并在控制台中给出以下错误
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
Breakpoint 1, 0x0000555555554a60 in main ()
[Inferior 1 (process 24472) exited normally]
The program '/home/m/gSoC/GasSimulator/./a.out' has exited with code 0 (0x00000000).
Run Code Online (Sandbox Code Playgroud)
转到“代码/首选项”菜单项下的“设置”,然后在出现的搜索框中输入 fortran。你会看到一行内容:"fortran.gfortranExecutable": "gfortran",
该行的标题为: // 指定 gfortran 可执行文件的完整路径。
which gfortran因此,请尝试将 gfortran 更改为在终端命令行上键入时得到的响应。
您可能还想将 json 文件中的“preLaunchTask”变量更改为 gfortran 路径。
| 归档时间: |
|
| 查看次数: |
6422 次 |
| 最近记录: |