User forums > Using Code::Blocks

Using code::blocks debbug tools with Fortran

<< < (2/3) > >>

Il Nero:
Yes!!!!!!
Now, changing the name, it seems to work... I have just experimented a Code::Blocks crash, but it is great that debbuger  is working!
Thank you very much!

dmoore:
if you use modules, you might find watching module variables a little bit tricky as gfortran (don't know about the others) uses name mangling that is at this point not understood in the debugger plugin.

For example, to watch variable bar in module foo, you have to watch something like foo_MP_bar. If bar is an array, things get even uglier: each array variable has members base and offset that point to the array data and I'm not sure you can see them correctly in codeblocks, but in gdb itself you can issue the command: x /10fg foo_MP_bar.base (assumes bar is type real)

Il Nero:

--- Quote from: dmoore on July 25, 2007, 03:29:58 pm ---if you use modules, you might find watching module variables a little bit tricky as gfortran (don't know about the others) uses name mangling that is at this point not understood in the debugger plugin.

For example, to watch variable bar in module foo, you have to watch something like foo_MP_bar. If bar is an array, things get even uglier: each array variable has members base and offset that point to the array data and I'm not sure you can see them correctly in codeblocks, but in gdb itself you can issue the command: x /10fg foo_MP_bar.base (assumes bar is type real)

--- End quote ---
Ok, this was my next question, you are a seer! thank you for your triks!
Stefano

Il Nero:
Hi all,
I have news for the debugger plug-in and Intel Fortran Compiler; as dmoore said fortran compilers rename the variables placed into a module in a strange way and so it is not obvious to watch them. I find that intel fortran compiler rename those variables in this way:

ModuleName_mp_VariableName_

this renaming is like the gfortran renaming but it adds an underscore at the end. To find how a compiler rename those variables just open a compiled .o (object compiled and not linked) with a text editor like vi.

Stefano   

dmoore:
thanks for the info. before it gets lost, it needs to go on the wiki.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version