gdb -- 没有名为的源文件- 英特尔编译器

发布于 2024-12-27 07:12:09 字数 797 浏览 2 评论 0原文

我正在从 ac 代码调用 fortran 90 代码。有一个 main() (在 c 中)调用同一文件中的包装函数,该函数调用 fortran 子例程(实际上在 liblibrary.a 中)。我正在Linux上工作。现在,我使用 gdb 来调试可执行文件,但它找不到 main.c 文件。我使用添加了工作目录

directory /my/working/directory

,但仍然显示没有名为 main.c 的文件
如果我在 gdb 中输入 list,它会显示一段 Fortran 代码。如果我输入 show language,它会显示当前源语言是 auto;目前为 c
如果我运行可执行文件,然后中断它并查看堆栈,它将显示我正在调用的 c 函数,但它不会说明源文件,而是说明 fortran 子例程和函数。
我正在尝试调查我是否正确地将变量从 c 传递到 fortran 并向后传递,我怀疑我没有。

idb 中或多或少也发生了同样的事情。当我尝试在 main.c 中打断时,它显示未找到。我用这些标志编译了 fortran 代码:

-g -O0 -check bounds -warn all -traceback -align all -align rec8byte

并用以下标志编译了 c 代码:

-g -O0  -Wall

欢迎所有建议。

I am calling fortran 90 code from a c code. There is a main() (in c) that calls a wrapper function in the same file, that calls a fortran subroutine (actually in a liblibrary.a). I am working on linux. Now, I'm using gdb to debug the executable, but it cannot find the main.c file. I added the working directory using

directory /my/working/directory

but still it says there is no file named main.c
If I type list inside gdb it shows me a piece of fortran code. If I type show language, it says The current source language is auto; currently c.
If I run the executable and then I interrupt it and look to the stack it will show me the c-functions I am calling, but it will not state the source file, that instead will state for the fortran subroutine and function.
I am trying to investigate if I am passing the variables correctly from c to fortran and backwards, I suspect I am not.

The same thing happens in idb, more or less. when I try to put a break in main.c, it says not found. I compiled the fortran code with these flags:

-g -O0 -check bounds -warn all -traceback -align all -align rec8byte

and the c-code with:

-g -O0  -Wall

All suggestions are welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子是时光的心 2025-01-03 07:12:09

您好,您需要额外的标志将调试信息放入可执行文件中。
这是英特尔编译器的手册:
http://cache-www.intel.com/cd /00/00/34/75/347599_347599.pdf
请尝试 -debug full,如第 35 页所述。

Hello you need additional flag to put debug info into your executable.
Here is manual for intel compiler:
http://cache-www.intel.com/cd/00/00/34/75/347599_347599.pdf
Please try -debug full as on page 35 written.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文