bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stepping through an elementary fortran prog


From: Ron Ford
Subject: stepping through an elementary fortran prog
Date: Mon, 7 Jul 2008 20:16:33 -0600
User-agent: 40tude_Dialog/2.0.15.84

Hello newsgroup,

I have the following fortran program that I am trying to step through with
gdb.  Previously, I have used visual debuggers.

program debug2   
USE ISO_C_BINDING, only: C_INT

INTEGER(C_INT) :: I

INTEGER :: J

I = 41
J = 42

PRINT *, I, J

PRINT kind(0), c_int

end program debug1
! gfortran -o debug -g debug2.f03
! gdb debug >text42.txt 2>text43.txt

I made huge progress on this by just writing up a query for a newsgroup.  I
thought that my process had hanged when I typed gdb debug >text42.txt, but
then I realized that it was all going into that files *except* 2 statements
that looked a lot like they came from stderr.  I then added the 2>, and I
think I may have identified the culprit.

Text42.txt reads:
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) break main
Breakpoint 1 at 0x401543: file ../../../trunk/libgfortran/fmain.c, line 11.
(gdb) run
Starting program: C:\Documents and
Settings\dan\Desktop\gfortran\source/debug.exe 
Loaded symbols for C:\WINDOWS\system32\ntdll.dll
Loaded symbols for C:\WINDOWS\system32\kernel32.dll
Loaded symbols for C:\WINDOWS\system32\msvcrt.dll

Breakpoint 1, main (argc=1, argv=0x3d24f8)
    at ../../../trunk/libgfortran/fmain.c:11
        in ../../../trunk/libgfortran/fmain.c
(gdb) step
13      in ../../../trunk/libgfortran/fmain.c
(gdb) step
*__gfortran_store_exe_path (
    argv0=0x3d2479 "C:\\Documents and
Settings\\dan\\Desktop\\gfortran\\source/debug.exe") at
../../../trunk/libgfortran/runtime/main.c:115
        in ../../../trunk/libgfortran/runtime/main.c
(gdb) step
122     in ../../../trunk/libgfortran/runtime/main.c
(gdb) print j
(gdb) quit
The program is running.  Exit anyway? (y or n) 

Text43.txt reads:
11      ../../../trunk/libgfortran/fmain.c: No such file or directory.
115     ../../../trunk/libgfortran/runtime/main.c: No such file or directory.
No symbol "j" in current context.

The first two came when I typed run and the third when I asked it to print
j.

Am I correct that I have to find an fmain.c and a main.c in order to have
this debugger tell me something?  Thanks for your response.
-- 
Whenever you hear a man speak of his love for his country, it is a sign
that he expects to be paid for it.
H. L. Mencken




reply via email to

[Prev in Thread] Current Thread [Next in Thread]