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.
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.