【发布时间】:2022-06-16 17:57:54
【问题描述】:
我是 VS Code 的新手,在调试 fortran 代码时遇到了麻烦,因为断点永远不会起作用并且会被跳过,就好像它们不存在一样。
我做了一个同样问题的测试程序:
program test
implicit none
real :: x
x = 10.0
print*, x
end program test
如果我在 print 语句处设置断点,调试器不会停止。
在运行期间,断点变为灰色,我收到此消息
Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.
这是 tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "gfortran",
"args": [
"test.f90"
],
"options": {
"cdw": "${workspaceRoot}"
}
}
]
}
还有这个 launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Run GDB",
"type": "cppdbg",
"request": "launch",
"program":"${workspaceRoot}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"externalConsole": false,
"MIMode": "gdb",
"preLaunchTask": "compile",
},
{
"name": "Intel Debug Attach",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
我安装了扩展 C/C++、Xavier Hahn 的 fortran、Miguel Carvajal 的 Modern Fortran、Fortran IntelliSense 和 Fortran Breakpoint Support。
有人愿意帮我一把吗?
【问题讨论】:
-
如何放置断点?
-
@VladimirF 通过单击编辑器中的行号旁边并放置一个红点,我进行了检查,它出现在断点列表中并且处于活动状态
-
更新:在运行过程中断点变灰,我收到消息“包含此断点的模块尚未加载或无法获取断点地址。”
-
哪个操作系统?
-
@VladimirF Linux Mint 20.3
标签: linux visual-studio-code fortran