fortran - gdb if 条件语法错误

标签 fortran gdb

我在文件 test.f90 中有一个非常简单的 Fortran 程序:

program test
   real :: x
   x=12
   write(*,*) x
end program test

我编译它
gfortran -g test.f90

然后我尝试使用 gdb:
gdb a.out
break 4 if a == 12

但我明白了
A syntax error in expression, near `= 12'.

我发现几个文档和论坛说这应该有效,但它没有......
这个简单条件的正确语法是什么?
我使用 gdb 7.6.1。

最佳答案

gdb 的文档有以下 to say about Fortran support :

GDB can be used to debug programs written in Fortran, but it currently supports only the features of Fortran 77 language.



作为逻辑条件x == 12是 Fortran 90 系谱,你可以改写
break 4 if x.eq.12

关于fortran - gdb if 条件语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46829796/

相关文章:

fortran - 互操作性 : Fortran to C++

c++ - 将环境变量设置为GDB中的空格

linux - 在 64 位 Linux 和 64 位处理器上运行 32 位汇编代码 : Explain the anomaly

c++ - 为什么循环中的 itr = vector.erase(itr) 导致内存损坏?我在这里做错了什么吗?

xcode - 在 Xcode 调试器中,是否可以执行 "run to current line"?

linux - 在 linux 上编译 fortran 程序并将可执行文件移动到另一台 linux 机器

fortran - Windows 7 64 位上的 compaq visual fortran?

wolfram-mathematica - 如何在 Mathematica 中使用 FORTRAN 子程序或函数?

在 Visual Studio 中将可变长度 c 字符串转换为 Fortran 字符串

ios - 不调用 ObjC 类方法。 GDB玩游戏?