Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29267 Discussions

How to show derived type array pointer content with idb ?

hanswb
Beginner
658 Views
Hello,

I'm trying to print the contents of derived type array pointerin the idb debugger:

Linux Application Debugger for 32-bit applications, Version 9.0-12, Build 20050729
...
stopped at [subroutine `MOD1`sub1():38:3 0x0804a168]
38 write(*,*) 'my_array',s2%int
(idb) print s1%cdata
type dwarf2_array_descriptor
(idb) whatis s1%cdata
character*1 fstring::cdata(:)
(idb) whatis s2%int
integer*4 my_array::int(:)
(idb) print s2%int
type dwarf2_array_descriptor
I only get this 'type dwarf2_array_descriptor' ???
How can I print the real content of the arrays ?

I compiled with ifort 9.0.27 with options:
ifort -g -debug extended mod1.f90 pointer.f90

source of mod1.f90 is
module mod1
type fstring
character (len=1), dimension(:), pointer :: cdata => null()
end type fstring
type my_array
integer, dimension(, pointer :: int
end type my_array
contains
subroutine sub1
type(fstring) :: s1
type(my_array) :: s2
integer :: i
allocate(s1%cdata(30))
allocate(s2%int(40))
s1%cdata(1) = 'a'
s1%cdata(2) = 'q'
s1%cdata(3) = 'w'
s1%cdata(4) = 'e'
s1%cdata(5) = 'r'
s1%cdata(6) = 't'
s1%cdata(7) = 'z'
s1%cdata(8) = 'u'
s1%cdata(9) = 'i'
s1%cdata(10) = 'o'
do i = 1, 40
s2%int(i) = i
end do
write(*,*) 'fstring',s1%cdata
write(*,*) 'my_array',s2%int
deallocate(s1%cdata)
deallocate(s2%int)
return
end subroutine sub1
end module mod1


This is just a test module. In the real application I get also only

type dwarf2_array_descriptor. But I need to know the contents.


Any help is appreciated.


Hans

Message Edited by sblionel on 10-05-2005 02:32 PM

0 Kudos
4 Replies
jft27
Beginner
658 Views
I too would really like to know how to do this.....

thanks
Jeremy
0 Kudos
Steven_L_Intel1
Employee
658 Views
Try a more recent version of the compiler and debugger.
0 Kudos
leif_r_hellevik
Beginner
658 Views
I have the same problem as desribed above. The suggested solution does not solve the problem as I have installed the latest compiler and debugger available.

To illustrate I have made a small testcode (16 lines). To reproduce,
compile with options -g -debug extended and set a breakpoint at the end of the code. Run and issue the command:
p AbsDataType


Then the following error should appear:
anarray = type dwarf2_array_descriptor


This problem must be resolved in order to make idb useful for developers.

Leif Rune Hellevik


------------------8<---------------------------------
PROGRAM test
IMPLICIT NONE

TYPE TAbsDataType
REAL, ALLOCATABLE :: AnArray (:)
END TYPE TAbsDataType


TYPE(TAbsDataType) :: AbsDataType

ALLOCATE(AbsDataType%AnArray(2))

AbsDataType%AnArray(1) = 1.0
AbsDataType%AnArray(1) = 2.0

END
------------------------8<----------------------------
0 Kudos
hanswb
Beginner
658 Views

Hello,

I reported the issue to Premier Support. They told methey have fixed it.

Hopefully the fix is included in the next release.

Hans

0 Kudos
Reply