Bug 33179 - gfortran doesn't emit type information for allocatable arrays
Summary: gfortran doesn't emit type information for allocatable arrays
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P3 major
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
Depends on:
Blocks: 24546
  Show dependency treegraph
 
Reported: 2007-08-24 19:06 UTC by Nikolay
Modified: 2007-12-09 22:55 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-28 14:45:47


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay 2007-08-24 19:06:57 UTC
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?
Comment 1 Francois-Xavier Coudert 2007-08-28 14:45:47 UTC
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.
Comment 2 Nikolay 2007-10-04 17:13:11 UTC
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.
Comment 3 Tobias Burnus 2007-12-09 22:55:17 UTC
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).