1

I am using gfortran with Code::Blocks 13.12 and NetBeans 8.0. Both are using GDB debugger. Codeblocks uses MinGW, netbeans uses Cygwin. In both cases I have latest stable compiler, debugger and make.

But neither of them can show array values in debugging mode if that array is defined in the subroutine. Same problem with allocated arrays. Code::Blocks shows either some nonsense with 3 values like (1.45654984984654984E-314) or just () without any values inside. Going to Properties and setting Start/Count doesn't help at all.

In NetBeans all arrays are always shown as {...} and nothing changes that.

Does anybody have experience with that? Since almost all my data are in arrays, the debugger is useless for me with problems like that.

DDR
  • 459
  • 5
  • 15
  • Please show how the array is declared end where in which place of the program you try to print the value. – Vladimir F Героям слава Sep 06 '14 at 15:52
  • Many people experience problems such as you report when using gdb with Fortran codes. I think one of the problems is that the authors of gdb were thinking of C-style arrays as they worked. There was a question on here recently (http://stackoverflow.com/questions/25677783/size-of-pointer-to-array-section-in-fortran90-2003-2008#comment40135898_25677783) with some explanation of the differences between the two languages' treatment of arrays. And there is a fair amount of discussion here on SO, and elsewhere on the Internet, about the difficulties of using gdb to inspect Fortran arrays. – High Performance Mark Sep 06 '14 at 16:27
  • So here it is (from codeblocks) [link]https://drive.google.com/file/d/0B48TslRvXpp0Qk54d2JmcDlkMlE/edit?usp=sharing The green 1D-array Pressure is OK, its size (3) is known from the beginning. The other 2 arrays (red) have the size No_of_substances, which is =5 in that case. So in the program window their real values are shown. In the watch list total nonsense is shown. Substances = [34,4,23,24,55] and x=[0.186, 0.113...] I can also show an example, where instead of nonsense stay only empty brackets (). – DDR Sep 06 '14 at 19:02

0 Answers0