laehc 0 Newbie Poster

I can't get anything useful from GDB 6.8 (GNU debugger) on a program compiled with gfortran.

I compiled testprog.exe with gfortran using the flags -g and -o (and no other flags) with gcc version 4.5.0.
It runs OK, I tried using GDB with it to learn about GDB, but without success.

Problems
1) Couldn't set a breakpoint (tried subroutine ci_w5_b14 and module modci_w5_b14)
2) Couldn't print variables and no local variables.
3) GDB thought it was in C. After setting the language to fortran it complains after "start" and "n".

By doing "n" four times, the program executed and finished as normal (four "n"s also get through it if I don't set the language, without the message about the language not matching the frame). Stepping with "s" does not produce any information I can make sense of.

This is copied from the Console window (missing out the copyright stuff etc.):

C:\MyFort\lib>gdb testprog
GNU gdb 6.8
This GDB was configured as "i686-pc-mingw32"...
(gdb) set language fortran
(gdb) break ci_w5_b14
Function "ci_w5_b14" not defined in loaded symbols.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) start
Breakpoint 1 at 0x42f9aa: file ../../../gcc-trunk/libgfortran/fmain.c, line 11.
Starting program: C:\MyFort\lib/testprog.exe
[New thread 10640.0x2a90]
main (argc=1, argv=0x9b0f80) at ../../../gcc-trunk/libgfortran/fmain.c:11
11      ../../../gcc-trunk/libgfortran/fmain.c: No such file or directory.
        in ../../../gcc-trunk/libgfortran/fmain.c
Warning: the current language does not match this frame.
(gdb) n
13      in ../../../gcc-trunk/libgfortran/fmain.c
(gdb) n
16      in ../../../gcc-trunk/libgfortran/fmain.c
(gdb) print k4
No symbol "k4" in current context.
(gdb) info locals
No locals.
(gdb) n
21      in ../../../gcc-trunk/libgfortran/fmain.c
(gdb) n
 enter:  start-size,  end-size,  size-ratio,  repeats,  seed,  range
10 14 1.3 1 0 100
 ( some output from testprog )
25      in ../../../gcc-trunk/libgfortran/fmain.c
(gdb)

I would appreciate any ideas about why it isn't working.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.