User forums > Help
Debugging fortran
MortenMacFly:
...additional info: I've modified the application as follows to verify it's not an issue with the character datatype:
--- Code: --- 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
--- End code ---
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:
--- Code: ---> 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)
--- End code ---
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]
mandrav:
--- Quote from: MortenMacFly on May 10, 2006, 12:51:44 pm ---
--- Quote from: mandrav on May 10, 2006, 11:40:49 am ---Regarding the watches tree, what's the output in the debugger's debug log?
--- End quote ---
Here it is:
--- Code: ---<snipped>
> info locals
Invalid F77 type code 3 in symbol table.
__g77_cilist_1 = (gdb)
</snipped>
--- End code ---
--- End quote ---
Well, as you can see, the watch tree displays exactly what GDB sends it. I see no parsing (or other) bug here...
MortenMacFly:
--- Quote from: mandrav on May 10, 2006, 03:04:34 pm ---I see no parsing (or other) bug here...
--- End quote ---
...depends on the point of view. If you want to show everything the debugger sends in the watch window then it's ok, of course. But my understanding of the "watch window" was to see "watches" - thus variables and stuff and no error messages from the debugger. What I meant with parsing was that IMHO such info's should be filtered out. So it's not really a bug, ok... agreed on that. Sorry. ;-)
With regards, Morten.
mandrav:
I see :)
JoachimB:
I tried :lol: the patch and it works!
Thank you both Mandrav and Morten for this quick fix
Now I couldn't figure out how to use the patch properly so I patched manually using the Codeblocks editor. Is there anyone that can hint where I can read about how to apply a patch in a little bit more automatic fashion. I did download patch.exe but could not work out how to use it. It was complaining about the format of the f77.patch file.
C:\Projects\CodeBlocks>patch -i f77.patch
can't find file to patch at input line 5
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|Index: src/plugins/debuggergdb/debuggergdb.cpp
|==============================================================
|--- src/plugins/debuggergdb/debuggergdb.cpp (revision 2438)
|+++ src/plugins/debuggergdb/debuggergdb.cpp (working copy)
--------------------------
File to patch:
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version