It looks like gfortran is using a descriptors to display allocatable arrays in f90, but I could never figure what is the type of the array: <1><202>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : array_descriptor2 <2><21c>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : data <2><22b>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : offset <2><23c>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : dtype DW_AT_type : <1fa> Any idea how I can get a type from that?
I think the data member should have the type. If it doesn't, it's one of the many debug-info gfortran bugs :( We could really use a hand in that area.
Ok, Here is how it is implemented now: <1><1b1>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : array_descriptor2 DW_AT_byte_size : 36 DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_sibling : <20a> <2><1cb>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : data DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_type : <20a> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) <2><1da>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : offset DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_type : <20c> DW_AT_data_member_location: 2 byte block: 23 4 (DW_OP_plus_uconst: 4) <2><1eb>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : dtype DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_type : <20c> DW_AT_data_member_location: 2 byte block: 23 8 (DW_OP_plus_uconst: 8) <2><1fb>: Abbrev Number: 3 (DW_TAG_member) DW_AT_name : dim DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_type : <214> DW_AT_data_member_location: 2 byte block: 23 c (DW_OP_plus_uconst: 12) <1><20a>: Abbrev Number: 4 (DW_TAG_pointer_type) DW_AT_byte_size : 4 <1><20c>: Abbrev Number: 5 (DW_TAG_base_type) DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) DW_AT_name : int4 Notice, that there is already a member 'data', that is a pointer to user array. The problem is, that it points to TAG <20a>, that is a pointer with missing AT type. I think at least, you need is to add type of the user data to this tag, then debugger can figure out what is the data.
I believe this has been fixed by the patch (PR 22244): http://gcc.gnu.org/ml/gcc-cvs/2007-12/msg00175.html Note for gdb you still need the patches from: http://sourceware.org/ml/gdb-patches/2007-11/msg00438.html Mark as FIXED (on the trunk/4.3.0).