|
Proposal for DWARF2 UPC Support |
- Modified 25 October 2002 to move the names out of the standard
space by adding upc to each of them. If this is adopted by the
DWARF committee the upc in the names could still be retained since
it is useful extra annotation, or it could be dropped at the time
the numerical values are moved into the standard ranges.
This change is cosmetic in that it only changes the names of the
tags, not their values, therefore the interface described remains
binary compatible with that previously described.
Rationale
The UPC (Unified Parallel C) language ( http://hpc.gwu.edu/~upc ) is a
parallel version of C, and therefore most of the constructs in UPC are
already well covered by DWARF.
However UPC extends C in two areas for which there is no obvious
expression within DWARF at present. These are
1) New type qualifiers
The "shared" type qualifier.
This is syntactically a type-qualifier (similar to const, volatile
or restrict), it differs only in that it also carries a positive
integer value with it which defines the shared block size. This is
a compile time constant which describes the way in which the shared
object is to be distributed over the UPC threads in the executing program.
The "strict" and "relaxed" type qualifiers.
These are exactly analogous to other type-qualifiers in C ("const",
"volatile", ...)
2) The expansible array declaration.
UPC allows one dimension of a shared array to be dimensioned with a
bound which is a multiple of the number of UPC threads instanced at
run time.
Neither of these concepts maps easily into any existing DWARF
attributes or tags, yet both could easily be represented using three
new tags and one new attribute. With these additions UPC would (I
believe) be fully covered by DWARF.
Detailed proposals
(Page numbers are against the Dwarf2p1-dearf6-010515-dif-base.pdf file
"Working Draft 6 with differences" from
http://www.eagercon.com/dwarf/dwarf2std.htm )
1: Add a language tag for UPC
Add DW_LANG_Upc to the supported set of languages,
Page 42/43: Add DW_LANG_Upc Unified Parallel C
to the table of language names.
Page 145: Add DW_LANG_Upc 0x8765
to the table of language encodings
Index-4: Add DW_LANG_Upc to the index.
2: Add DW_TAG_shared_type
Add a new tag (analogous to DW_TAG_const_type or DW_TAG_volatile_type)
to allow the specification of a shared type.
Page 8: In the table, add DW_TAG_upc_shared_type
Page 69: In the table add
DW_TAG_upc_shared_type UPC shared qualified type
Page 84 (say ?) add a description of the shared_type
Shared type entries
The UPC language extends ANSI C by adding the concept of shared
objects which are expressed by adding the "shared [blocksize]"
directive to a type. For instance
int shared [10] foo;
declares an integer which is shared with a blocksize of 10, or
int shared *p;
declares a local pointer to a shared integer with blocksize 1.
The DW_TAG_upc_shared tag allows this concept to be expressed in
DWARF.
The DW_TAG_upc_shared_type expects as children the attributes
1) DW_AT_count which gives the shared block size (if this is
absent, then "infinite" blocksize is used, as expressed in UPC
by "shared []").
2) DW_AT_type the type to which the shared property is being
applied.
The type used in the first example above would then be expressed as
DW_TAG_upc_shared
DW_AT_type reference to "int"
DW_AT_count 10
Page 130: In the table add
DW_TAG_upc_shared_type 0x8765
Page 159: In the table add
DW_TAG_upc_shared_type DW_AT_count
DW_AT_type
3: Add DW_TAG_upc_strict
Add a new tag (analogous to DW_TAG_const_type or DW_TAG_volatile_type)
to allow the specification of the "strict" property of a type.
Page 8: In the table, add DW_TAG_upc_strict_type
Page 69: In the table add
DW_TAG_upc_strict_type UPC strict qualified type
Page 84 (say ?) add a description of the strict_type
Strict type entries
The DW_TAG_upc_strict_type encodes the UPC "strict" qualifier.
Page 130: In the table add
DW_TAG_upc_strict_type 0x8766
Page 159: In the table add
DW_TAG_upc_strict_type DW_AT_type
4: Add DW_TAG_upc_relaxed
Add a new tag (analogous to DW_TAG_const_type or DW_TAG_volatile_type)
to allow the specification of the "relaxed" property of a type.
Page 8: In the table, add DW_TAG_upc_relaxed_type
Page 69: In the table add
DW_TAG_upc_relaxed_type UPC relaxed qualified type
Page 84 (say ?) add a description of the relaxed_type
Relaxed type entries
The DW_TAG_upc_relaxed_type encodes the UPC "relaxed" qualifier.
Page 130: In the table add
DW_TAG_upc_relaxed_type 0x8767
Page 159: In the table add
DW_TAG_upc_relaxed_type DW_AT_type
5: Support the "THREADS scaled" array declaration
Add a new attribute to allow the THREADS scaled array declaration to
be expressed.
Page 16: In the table add
DW_AT_upc_threads_scaled Subrange type should be interpreted
scaled by THREADS
Page 85: In the description of the subrange type add.
If the subrange type has a DW_AT_upc_threads_scaled attribute, then
it represents a UPC array bound which should be scaled by the
run time "THREADS" value (the number of UPC threads in this
execution of the program). This allows the expression of UPC
arrays declared like this example :-
int shared foo[34*THREADS][10][20];
Page 133: In the table add
DW_AT_upc_threads_scaled 0x3210
Page 169: In the entry for DW_TAG_subrange_type
add DW_AT_upc_threads_scaled