Issue 090402.2: Clarify DW_TAG_condition_name

Author: Paul Robinson
Champion: Paul Robinson
Date submitted: 2009-04-02
Date revised:
Date closed:
Type: Editorial
Status: Accepted
DWARF Version: 4
In section 5.7 Condition Entries, the normative text currently reads:

    The DW_TAG_condition debugging information entry describes a COBOL
    level-88 condition.  If a name has been given to the condition, the
    condition entry has a DW_AT_name attribute whose value is a null-
    terminated string giving the condition name as it appears in the
    source program.

    The condition entry's parent entry describes the conditional
    variable; normally this will be a DW_TAG_variable or DW_TAG_member
    entry.  The type of the condition entry is derived from the
    DW_AT_type attribute of the parent entry.

    The condition entry owns DW_TAG_constant and/or DW_TAG_subrange_type
    entries that describe the constant values associated with the
    condition.  If any child entry has a DW_AT_type attribute, that
    attribute should describe a type compatible with the type derived
    from the condition entry's parent.

There are a few problems with this description.

1. The type "derived from" the parent is not well defined. In particular
   what happens when the parent has an array type is not specified, and
   it needs to be because it's not obvious.

2. The "type of the condition entry" is actually best described as
   boolean, and is not interesting (so don't bother describing it at
   all).  What matters is the relationship between the type of the
   conditional variable and the type(s) of the constant(s).

3. Normative text explicitly mentions COBOL.

I propose to replace the normative text with the following.

    The DW_TAG_condition debugging information entry describes a logical
    condition that tests whether a given data item's value matches one
    of a set of constant values.  If a name has been given to the
    condition, the condition entry has a DW_AT_name attribute whose
    value is a null-terminated string giving the condition name as it
    appears in the source program.

    The condition entry's parent entry describes the conditional
    variable; normally this will be a DW_TAG_variable, DW_TAG_member or
    DW_TAG_formal_parameter entry.  If the parent entry has an array
    type, the condition can test any invididual element, but not the
    array as a whole.  The condition entry implicitly specifies a
    "comparison type" that is the type of an array element if the parent
    has an array type, otherwise it is the type of the parent entry.

    The condition entry owns DW_TAG_constant and/or DW_TAG_subrange_type
    entries that describe the constant values associated with the
    condition.  If any child entry has a DW_AT_type attribute, that 
    attribute should describe a type compatible with the comparison type;
    otherwise the child's type is the same as the comparison type.

The non-normative text would remain as is.

--

Accepted July 7, 2009.