mandrav: I think he is right. Why it works for me is because I'm usually mixing Fortran and C/C++ programs together using the G2C library. Thus the source is converted into C and than translated. So debugging works for me on a "C" level. If I compile a "pure" (native) Fortran application is doesn't work for me, too... I never tried that before... :oops:
With regards, Morten.
Edit: I guess the important part of JoachimB's output is:
> break tiny.f:4
Breakpoint 1 at 0x40131b: file tiny.f, line 4.
(gdb)
> run
Breakpoint 1, MAIN__ () at tiny.f:4
C:/Projects/Tiny/fello/tiny.f:4:84:beg:0x40131b
Current language: auto; currently fortran
(gdb)
Thanks Mikael, I tried but it makes no difference
It doesn't depend on the debugger's version. I guess it has to do with the parsing of the debugger's output. This is "optimised" for C/C++ code. If you have a hello world C++ application the output looks different:
> break main.cpp:5
Breakpoint 1 at 0x401408: file main.cpp, line 5.
(gdb)
> run
Breakpoint 1, main () at main.cpp:5
C:/DOKUME~1/morten/Desktop/haha/main.cpp:5:38:beg:0x401408
(gdb)
...again in comparision, here is the fortran's output:
> break main.f:4
Breakpoint 2 at 0x40131b: file main.f, line 4.
(gdb)
> run
Breakpoint 2, MAIN__ () at main.f:4
C:/DOKUME~1/morten/Desktop/huhu/main.f:4:81:beg:0x40131b
Current language: auto; currently fortran
(gdb)
I've had a look at it already but fall asleep yesterday... ;-) Give me some time.
...or I'm sure mandrav knows - he wrote the debugger's parser.
With regards, Morten.
So I 'm gonna need your help on this.
...got it: The problem is indeed inside DebuggerGDB::SyncEditor. The issue lies in the following lines of code:
FileType ft = FileTypeOf(filename);
if (ft == ftOther)
return; // don't try to open unknown files
Since for a fortran (*.f) file type the "if" statement is true, DebuggerGDB::SyncEditor just returns and nothing happens.
I hope you have an idea what to do. I'm not sure whether it makes sense just to remove that "if" statement? ...or should we add another file type "ftFortran"?
With regards, Morten.
Regarding the watches tree, what's the output in the debugger's debug log?
Here it is:
> break main.f:4
Breakpoint 1 at 0x40131b: file main.f, line 4.
(gdb)
> run
Breakpoint 1, MAIN__ () at main.f:4
C:/DOKUME~1/morten/Desktop/fortran/main.f:4:81:beg:0x40131b
Current language: auto; currently fortran
(gdb)
> info locals
Invalid F77 type code 3 in symbol table.
__g77_cilist_1 = (gdb)
> info args
No arguments.
(gdb)
...additional info: I've modified the application as follows to verify it's not an issue with the character datatype:
PROGRAM TINY
INTEGER IINT
CHARACTER OCHAR*2
IINT=2
OCHAR='AA'
WRITE(UNIT=*,FMT=*)'Hello world'
WRITE(UNIT=*,FMT=995) IINT
WRITE(UNIT=*,FMT=996) OCHAR
995 FORMAT(I2)
996 FORMAT(A2)
END
But I get the same output on the watches window. Anyway, if I add the watches manually (right-click in the watches window and add watch) I see the values as witin the image attached. The debugger's output in that case is:
> break main.f:9
Breakpoint 1 at 0x401310: file main.f, line 9.
(gdb)
> run
Breakpoint 1, MAIN__ () at main.f:9
C:/DOKUME~1/morten/Desktop/fortran/main.f:9:97:beg:0x401310
Current language: auto; currently fortran
(gdb)
> info locals
Invalid F77 type code 3 in symbol table.
__g77_cilist_0 = (gdb)
> info args
No arguments.
(gdb)
> info locals
Invalid F77 type code 3 in symbol table.
__g77_cilist_0 = (gdb)
> info args
No arguments.
(gdb)
> whatis IINT
type = integer
(gdb)
> output IINT
2(gdb)
> info locals
Invalid F77 type code 3 in symbol table.
__g77_cilist_0 = (gdb)
> info args
No arguments.
(gdb)
> whatis IINT
type = integer
(gdb)
> output IINT
2(gdb)
> whatis OCHAR
type = char (2)
(gdb)
> output OCHAR
(65 'A', 65 'A')(gdb)
With regards, Morten.
Ps.: I've also googled around and found an issue with the GDB debugger and complex data types in fortran. This could be resolved by adding the compiler switch "-fno-emulate-complex" - which I tried. Unfortunately no success (which doesn't suprise me since we are not using the COMPLEX data type in this example).
[attachment deleted by admin]