[Dwarf-Discuss] DWARF representation for Fortran descriptors

John DelSignore John.DelSignore at roguewave.com
Thu Oct 28 14:35:34 PDT 2010


Also, from the debugger implementor perspective, it would help to know how the compiler represents the objects before giving advice on what the DWARF should look like.

Usually, descriptors are used for array objects, but unless Kendrick's example is incomplete, it appears that the objects are pointer/allocatable scalars. (IIRC, that might be a Fortran 2003 extension.)

If the compiler uses a trimmed-down array descriptor object to represent pointer/allocatable scalars, then the way it should be represented in DWARF is probably different than if the compiler uses a C/C++ pointer object (like an "int *").

Cheers, John D.


Ron Brender wrote:
> Kendrick,
> 
> Take a look at Appendix D.2.1. Hopefully that will answer your question. 
> If not, try some more specific questions...
> 
> Ron
> 
> -------------------------------------------
> On 10/28/2010 5:09 PM, Kendrick Wong wrote:
>> How are Fortran descriptors represented in DWARF?
>>
>> Take this program, for example:
>>
>> INTEGER, POINTER :: obj1
>> INTEGER, ALLOCATABLE :: obj2
>>
>> What is the correct way to represent obj1, obj2 and their types?
>>
>> $1a: DW_TAG_base_type
>> DW_AT_name (INTEGER)
>> DW_AT_encoding (DW_ATE_signed)
>> DW_AT_associated (...)
>> DW_AT_allocated (...)
>>
>> $2a: DW_TAG_variable
>> DW_AT_name (obj1)
>> DW_AT_type ($1a)
>> DW_AT_location (...)
>>
>> $3a: DW_TAG_variable
>> DW_AT_name (obj2)
>> DW_AT_type ($1a)
>> DW_AT_location (...)
>>
>> or
>>
>> $1b: DW_TAG_base_type
>> DW_AT_name (INTEGER)
>> DW_AT_encoding (DW_ATE_signed)
>>
>> $2b: DW_TAG_pointer_type
>> DW_AT_associated (...)
>> DW_AT_type ($1b)
>>
>> $3b: DW_TAG_pointer_type
>> DW_AT_allocated (...)
>> DW_AT_type ($1b)
>>
>> $4b: DW_TAG_variable
>> DW_AT_name (obj1)
>> DW_AT_type ($2b)
>> DW_AT_location (...)
>>
>> $5b: DW_TAG_variable
>> DW_AT_name (obj2)
>> DW_AT_type ($3b)
>> DW_AT_location (...)
>>
>> Or another way?
>>
>> Kendrick Wong
>>
>>
>>
>> _______________________________________________
>> Dwarf-Discuss mailing list
>> Dwarf-Discuss at lists.dwarfstd.org
>> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org
> 
> 
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org
> 



More information about the Dwarf-Discuss mailing list