This is the mail archive of the
dwarf2@corp.sgi.com
mailing list for the dwarf2 project.
Re: Fortran Common Blocks
- To: "Knott, Martin" <martin at epc dot co dot uk>
- Subject: Re: Fortran Common Blocks
- From: Michael Eager <eager at eagercon dot com>
- Date: Thu, 13 Apr 2000 08:38:14 -0700
- CC: "'dwarf2 at corp dot sgi dot com'" <dwarf2 at corp dot sgi dot com>
- References: <CF654D964573D311A1CA0090278A36FF030A7A@EDIN_EXM1>
- Reply-To: Michael Eager <eager at eagercon dot com>
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