This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Fortran Common Blocks


I'm sure that there are folks with much better knowledge of Fortran than
I, but my first thought is that common blocks are global, not local
to a subroutine.  This suggests to me that the DW_TAG_common_block should
be a sibling of DW_TAG_subprogram, not a child.

"Knott, Martin" wrote:
> 
> Hi
> 
> I am currently attempting to generate Dwarf2 information for common blocks.
> However, I am a little curious by the messages that DwarfDump produces:
> 
> <1><  123>      DW_TAG_subprogram
>                 DW_AT_decl_line             1
>                 DW_AT_decl_column           0
>                 DW_AT_decl_file             1
>                 DW_AT_sibling               <192>
>                 DW_AT_accessibility         DW_ACCESS_public
>                 DW_AT_name                  main.program
>                 DW_AT_type                  <115>
>                 DW_AT_prototyped            no
>                 DW_AT_high_pc               0x8048d20
>                 DW_AT_low_pc                0x8048c50
>                 DW_AT_external              yes(1)
> *** DWARF CHECK: DW_TAG_common_block: tag-tree relation is not valid ***
> <2><  159>      DW_TAG_common_block
>                 DW_AT_decl_line             6
>                 DW_AT_decl_column           0
>                 DW_AT_decl_file             1
>                 DW_AT_sibling               <191>
>                 DW_AT_declaration           yes(1)
>                 DW_AT_name                  acommon
> *** DWARF CHECK: DW_TAG_variable: tag-tree relation is not valid ***
> <3><  176>      DW_TAG_variable
>                 DW_AT_decl_line             6
>                 DW_AT_decl_column           0
>                 DW_AT_decl_file             1
>                 DW_AT_accessibility         DW_ACCESS_public
>                 DW_AT_name                  arr
>                 DW_AT_type                  <192>
>                 DW_AT_external              no
> 
> (I downloaded DwarfDump from http://reality.sgi.com/davea/objectinfo.html).
> 
> The above output suggests that:
> a) DW_TAG_common_block cannot be a child of DW_TAG_subprogram, and
> b) DW_TAG_variable cannot be a child of DW_TAG_common_block.
> 
> I notice also that in the Dwarf2 draft spec the use of
> DW_TAG_common_inclusion is mentioned in relation to DW_TAG_subprogram
> entries.
> 
> Could anyone enlighten me as to how the standard envisages common blocks to
> be handled, who the parent of a DW_TAG_common_block DIE is supposed to be,
> and who its children can be?
> 
> Thanks
> Martin Knott
> 
> Edinburgh Portable Compilers Ltd
> 17 Alva Street
> Edinburgh
> Scotland


-- 
Michael Eager	 Eager Consulting     eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]