Re: fortran source file renamed when using preprocessor directives



ravi <gotothati@xxxxxxxxx> writes:

Dear all,

I have written a simple FORTRAN program which include some header
files.

like:

$> cat test.F
program test
include 'test.h'
print *,"Hello World"
end


and test.h
print *,"This is test.h"


i have compiled as

$> g77 -ffree-form -g test.F -o test


and tried to debug with gdb:

(gdb) file test
Reading symbols from /home/ssdg_gridhra/tempdir/test/LibTest/
test...done.
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b main
Breakpoint 1 at 0x804a4e6
(gdb) r
Starting program: /home/ssdg_gridhra/tempdir/test/LibTest/fsrl.deb

Breakpoint 1, 0x0804a4e6 in main ()
(gdb) where
#0 0x0804a4e6 in main ()
(gdb) l
1 /tmp/ccjXFIn1.f: No such file or directory.
in /tmp/ccjXFIn1.f

Try this instead

(gdb) file test
(gdb) b MAIN__
(gdb) r

Note the two trailing underscores after the all-caps MAIN. Your
breakpoint above is in the g77 Fortran run-time initialization, not in
your program.

Chip

--
Charles M. "Chip" Coldwell
"Turn on, log in, tune out"
Somerville, Massachusetts, New England
.



Relevant Pages

  • How to inspect an array value in gdb?
    ... I am stepping through my Fortran program using gdb. ... I hope to inspect an array value. ... Now in gdb, after reaching this line, I want to see the value of smc. ...
    (comp.lang.fortran)
  • fortran source file renamed when using preprocessor directives
    ... I have written a simple FORTRAN program which include some header ... and tried to debug with gdb: ... When I write the file as test.f it is showing ...
    (comp.lang.fortran)
  • How can I set breakpoint with GDB...
    ... I am just writing some FORTRAN program under Linux. ... Now I have some error after executing it. ... But if I use GDB to ... I can't set breakpoints in that. ...
    (comp.lang.fortran)
  • How can I set breakpoint with GDB...
    ... I am just writing some FORTRAN program under Linux. ... Now I have some error after executing it. ... But if I use GDB to ... I can't set breakpoints in that. ...
    (comp.lang.fortran)
  • [PATCH 9/21] KGDB: This adds basic support to the MIPS architecture
    ... This patch also adds support for the rs232 early kgdb access for MIPS ... * To enable debugger support, ... * or error conditions to be properly intercepted and reported to gdb. ... a breakpoint needs to be generated to begin communication. ...
    (Linux-Kernel)