User forums > Help

Debugging fortran

<< < (6/6)

MortenMacFly:
mandrav: Do you have plans to apply the (first/second) patch to SVN in the near future? Otherwise I'd put it to the patch tracker at BerliOS to make sure it's not getting lost.

JoachimB: What version of "patch" are you using? I'm using v2.5.9 the from the GNU Win32 tools which works (...usually ;-)). Did you try the "-u" option in addition? (The patches are usually in unified format). And of course you have to apply them in the right directory. So in your case there should really be a
"src/plugins/debuggergdb/debuggergdb.cpp" file/folder under "C:\Projects\CodeBlocks"...?!

With regards, Morten.

mandrav:

--- Quote from: MortenMacFly on May 12, 2006, 07:32:43 am ---mandrav: Do you have plans to apply the (first/second) patch to SVN in the near future?

--- End quote ---

Yes, today.

joachim:
Hi Morten,

I downloaded the 2.5.9 and now after reading the manual I understand how it works with the -u and the strip -p option. Definitely more convienient then the manual way 8)

Joachim(b)

dmoore:
Hi guys: thought I'd append a message to an old thread since its the same topic. Can anyone tell me the current status of debugging fortran code in C::B using GDB? A colleague wants me to inspect her fortran code and I was hoping to avoid installing Visual Studio + Compaq Fortran etc.
I gave it a quick try but as described above, the editor still does not track the debugger's position in the code. I can live with this. By far the biggest problem is that the watch etc. don't work at all. Has anyone else managed to get a more successful gdb fortran session working in C::B?

EDIT: I forgot to add that I'm using the "new" Mingw G95 compiler (as opposed to G77 compiler) - so the problem is most likely the compiler... unfortunately the stuff i coded in fortran 90, so g77 isn't an option.

thanks
Damien

dmoore:
I've added a trivial patch under pseudonym "cripes" (dmoore was taken already) to include .f95 and .f03 in the known filetypes. (shouldn't this stuff be in xml files, loaded and queried for known types as necessary?)

some annoying things when debugging fortran g95 with gdb (i don't know if this is also true of g77):
1. all global variables have a name prefix of something like global_variable_MP_ (i can't remember the exact prefix because i only have g95 installed on my work machine) so to watch a variable called "k" you actually need to watch global_variable_MP_k. This will make it almost impossible to watch expressions without the user typing the longhand name or some smart parsing.
2. It doesn't look like there is an easy way to watch the contents of arrays either (dereferencing with () or [] didn't seem to do the trick)
3. There's some weird jumping with debug step and next where the current line of code jumps to the start of the function header before proceeding to the next point in the code. That is, you have to press next twice to get to the next line (This may just be GDB/g95 weirdness that can't be fixed)
(4. not really a problem, but a gotcha) all variable names are transformed to lower case in the debugger (since fortran is case insensitive)

I don't know if any of this is patchable. For one, we would need a consistent way to identify that it is fortran code being debugged (I guess could be based on the file extension of the current source). I personally find Fortran a clumsy language that's best avoided, so unless I am required at work to spend more time debugging it in GDB, I won't know enough to come up with a suitable patch.

Navigation

[0] Message Index

[*] Previous page

Go to full version