【发布时间】:2019-01-22 18:17:03
【问题描述】:
我正在尝试在 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"
}
]
因为我使用的是 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).
【问题讨论】:
-
我几个月来一直在尝试让 VScode 运行 fortran 代码,但没有成功。如果它对你有用,你可以在这里添加相同的指针吗?不是调试器,只是运行一个简单的代码。
-
@jmh 我不确定这是否是你想要的,但我在 VS 代码中从终端控制台编译了代码并做了一个
./a.out以在 VS Code 内的终端中正常运行它。
标签: debugging visual-studio-code fortran gdb gfortran