简体   繁体   English

使用Emacs调试Fortran程序(在MacOS上)

[英]Debugging a Fortran program using Emacs (on MacOS)

I am trying to debug a fortran program within Emacs using GDB. 我正在尝试使用GDB在Emacs中调试fortran程序。 My compiler is intel fortran 2017.4. 我的编译器是intel fortran 2017.4。 The problem is with a particular subroutine which inverts a matrix. 问题在于一个特定的子程序,该子程序将矩阵求逆。 The program runs without a problem when the size of the matrix is "small" ie 100x100. 当矩阵的大小为“小”(即100x100)时,程序可以正常运行。 When I increase the size of the matrix to, for example 600x600, I get the following message: "Thread 3 received signal SIGSEGV, Segmentation fault." 当我将矩阵的大小增加到例如600x600时,我得到以下消息:“线程3收到信号SIGSEGV,分段错误。”

Now, if I try to debug the program launching GDB from the terminal, everything works fine. 现在,如果我尝试调试从终端启动GDB的程序,一切正常。 I strongly prefer to debug the program from within Emacs since it would save me a lot of time. 我非常喜欢从Emacs中调试程序,因为它可以节省很多时间。 Any ideas about how can I fix this issue? 关于如何解决此问题的任何想法?

I already try to increase the stack size to the max (which is 65532 for MAC) and all the arrays are allocated on the heap. 我已经尝试将堆栈大小增加到最大(对于MAC为65532),并且所有阵列都分配在堆上。

Thanks for your help, 谢谢你的帮助,

Now, if I try to debug the program launching GDB from the terminal, everything works fine. 现在,如果我尝试调试从终端启动GDB的程序,一切正常。

It appears that your program does not crash when run from GDB (whether GDB is invoked from within Emacs or from a terminal), in which case your references to Emacs are superfluous. 从GDB运行时(无论是从Emacs内部还是从终端调用GDB),您的程序似乎都不会崩溃,在这种情况下,对Emacs的引用是多余的。

Some of the reasons why a program may not crash under GDB are listed here . 此处列出一些程序可能无法在GDB下崩溃的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM