This is the mail archive of the
dwarf2@corp.sgi.com
mailing list for the dwarf2 project.
Fortran Common Blocks
- To: dwarf2 at corp dot sgi dot com
- Subject: Fortran Common Blocks
- From: davea at quasar dot engr dot sgi dot com (David B Anderson)
- Date: Thu, 13 Apr 2000 11:08:08 -0700 (PDT)
- Reply-To: davea at quasar dot engr dot sgi dot com (David B Anderson)
"Knott, Martin" <martin@epc.co.uk> writes:
>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
As James Cownie writes, this is sensible dwarf.
You will find the input that causes the
validity table to be built In the dwarfdump source, in the file
tag_tree.list under DW_TAG_subprogram there is no
DW_TAG_common_block. That is a bug in the table.
Note the table uses 2 32bit ints for bit flags rather than a single
64bit int : when dwarfdump was written, 'long long' was
not considered quite 'normal'...
SGI f77 generates for example, on James's example:
<1>< 128> DW_TAG_subprogram
DW_AT_decl_file 1
DW_AT_decl_line 2
DW_AT_decl_column 18
DW_AT_name foo
DW_AT_external yes(1)
DW_AT_frame_base DW_OP_breg29+0
DW_AT_low_pc 0
DW_AT_high_pc 0x8
DW_AT_MIPS_fde 32
DW_AT_sibling <209>
<2>< 156> DW_TAG_common_inclusion
DW_AT_decl_line 5
DW_AT_decl_column 15
DW_AT_common_reference <163>
<2>< 163> DW_TAG_common_block
DW_AT_name madman
DW_AT_location DW_OP_addr 0
<3>< 177> DW_TAG_variable
...
and gets the same warning with -k.
Seems like making the checking be optional was not such a good idea,
as I never think to turn it on.
Anyway, fix your copy of the table.
Also, add
DW_TAG_variable under
the
DW_TAG_common_block entry
in the list.
Likely there are other botches in the list too.
Let me know of those you find.
I'll fix the master source.
It's time for a re-distribution of dwarfdump, but that may not
be for a few days yet.
davea@sgi.com