This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Q: How do I use gdb with egcs fortran


> Programs are compiled with -g (I also tried -ggdb3) but
> still I get message "No default source file yet".

Try setting a breakpoint at MAIN__ and issuing a "run" command.
After that the debugger will (hopefully) find the source file.
The reason is that the debugger begins program execution at the
startup code, not at the first line of your FORTRAN program:

  > gdb hello
  GDB is free software and you are welcome to distribute copies of it
   under certain conditions; type "show copying" to see the conditions.
  There is absolutely no warranty for GDB; type "show warranty" for
  details.
  GDB 4.16 (i486-unknown-linux --target i486-linux), 
  Copyright 1996 Free Software Foundation, Inc...
  (gdb) b MAIN__
  Breakpoint 1 at 0x8048d9f: file hello.f, line 1.
  (gdb) r
  Starting program: /tmp/tim/hello 

  Breakpoint 1, MAIN__ () at hello.f:1
  1             WRITE(*,*) "Hello, world!"
  Current language:  auto; currently fortran
  (gdb) l
  1             WRITE(*,*) "Hello, world!"
  2             END
  (gdb) 




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]