Class DWARFAmbigNumericAttribute

  • All Implemented Interfaces:

    public class DWARFAmbigNumericAttribute
    extends DWARFNumericAttribute
    Stores a integer value (with ambiguous signedness) in a long, with a mask that will allow the consumer at a later time to treat the value as signed or unsigned.

    When supplied with a long value that was originally a smaller integer with its high-bit set, java will sign-extend the value to 64 bits. To treat this as an unsigned value, the mask needs to match the bitwidth of the supplied value, and is used to return the relevant number of bits from the value. (See NumberUtil.UNSIGNED_BYTE_MASK, etc)

    This allows us to simplify the storage of a variable sized int value (1 byte, 2 byte, 4 byte, 8 byte) using just a 8 byte long and an 8 byte mask.