Issue 080622.1: Multiple entry stack values

Author: Ron Brender
Champion: Brender
Date submitted: 2008-06-22
Date revised:
Date closed:
Type: Clarification
Status: Accepted
DWARF Version: 4
Background:
DW_OP_constu and _consts are can represent 128-bit values but the
spec is silent about the interpretation to be given for a value that
provides/requires more bits than the size of an address (which defines
the size of DWARF stack elements). One might suppose that either
1) this is an error in the DWARF expression [bad producer] or
2) the value is simply (and silently) truncated to the stack element
size.

Similarly for DW_OP_const8u and _const8s on an implementation where
the DWARF stack is 32-bits in size.

I suggest we really should close this omission. I recommend that
truncation is the required interpretation. See below. Other thoughts?

DW_OP_?deref*

DW_OP_deref_size and DW_OP_xderef_size allow specification of the
number of bytes to be fetched and pushed on the DWARF stack. Both
clearly limit this size to a value that "may not be larger than the
size of an address on the target machine".

In combination with a broader proposal to allow multiple entry
values on the DWARF stack it would be appropriate and sufficient to
drop this restriction as a way to provide operators that push multiple
entry values on the DWARF stack.

Proposal
--------

In Section 2.5.1.1 Literal Encodings (p14), add the following to the
first sentence (preceding the list):

   "If the value of a constant in one of these operators is too large
   to be stored in a single stack element, the value is truncated to
   the element size and the low-order bits are pushed on the stack."


====

Accepted.