Mail Archives: djgpp/1997/02/09/22:51:12
On Sat, 8 Feb 1997 22:39:07 GMT, D DOT J DOT Murdoch AT bris DOT ac DOT uk (Duncan
Murdoch) wrote:
>I'm trying to use f2c with djgpp, and almost everything appears to be
>fine except for debugging. There are several suggestions in the
>various help files that if I use the f2c -g option to put lines like
>
>#line 1 "reject.f"
>
>into the generated C, then gdb should show me the Fortran source,
>rather than the C source. However, I can't seem to get that to
>happen.
After a suggestion from Eli Zaretskii, I found the solution to this
myself. This should also work for people using other code generators
(Bison, etc.):
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 myprog.c:
copy myprog.f myprog.c
4. Run gdb:
gdb myprog.exe
Duncan Murdoch
- Raw text -