Mail Archives: djgpp/1997/02/09/11:20:19
On Sun, 9 Feb 1997 13:30:14 +0200 (IST), you wrote:
>I think this is one of the adverse effects of the basic deficiency in the
>COFF debugging info that DJGPP uses. See section 12.8 of the DJGPP FAQ
>list for more on this.
Thanks for the pointer. I read that, but I was hoping there was a way
around it. It says that COFF can only handle a single source file per
object module. That's all I've got; I'd be happy to have it forget
all about the .c file, and just record the line correspondence from
the .f file.
12.8 also says that "It does include correct line numbers, but the
name of the source file is wrong, so debugging such files just doesn't
work." I just decided to try copying the .f file on top of the .c
(after compiling, of course), and it works!
So here is the answer to my question:
To debug a Fortran program "myprog.f" using f2c, gcc and gdb:
1. Run f2c with the -g option:
f2c -g myprog.f
2. Compile using gcc with the -g option.
gcc -g myprog.c -o myprog.exe -lf2c -lm
3. Copy the fortran over myproc.c:
copy myprog.f myprog.c
4. Run gdb:
gdb myprog.exe
Duncan Murdoch
- Raw text -