Class DWARFNumericAttribute

java.lang.Object
ghidra.program.model.scalar.Scalar
ghidra.app.util.bin.format.dwarf4.attribs.DWARFNumericAttribute
All Implemented Interfaces:
DWARFAttributeValue

public class DWARFNumericAttribute extends Scalar implements DWARFAttributeValue
DWARF numeric attribute.
  • Constructor Details

    • DWARFNumericAttribute

      public DWARFNumericAttribute(long value)
      Creates a new numeric value, using 64 bits and marked as signed
      Parameters:
      value - long 64 bit value
    • DWARFNumericAttribute

      public DWARFNumericAttribute(int bitLength, long value, boolean signed)
      Creates a new numeric value, using the specific bitLength and value.
      Parameters:
      bitLength - number of bits, valid values are 1..64, or 0 if value is also 0
      value - value of the scalar, any bits that are set above bitLength will be ignored
      signed - true for a signed value, false for an unsigned value.
    • DWARFNumericAttribute

      public DWARFNumericAttribute(int bitLength, long value, boolean signed, boolean ambiguous)
      Creates a new numeric value, using the specific bitLength and value.
      Parameters:
      bitLength - number of bits, valid values are 1..64, or 0 if value is also 0
      value - value of the scalar, any bits that are set above bitLength will be ignored
      signed - true for a signed value, false for an unsigned value.
      ambiguous - true for value with ambiguous signedness (signed parameter should not be trusted), false for value where the signed parameter is known to be correct
  • Method Details

    • isAmbiguousSignedness

      public boolean isAmbiguousSignedness()
      Returns boolean flag, if true this value's signedness is up to the user of the value, if false the signedness was determined when the value was constructed.
      Returns:
      boolean flag, if true this value's signedness is up to the user of the value, if false the signedness was determined when the value was constructed
    • getValueWithSignednessHint

      public long getValueWithSignednessHint(boolean signednessHint)
      Returns the value, forcing the signedness of ambiguous values using the specified hint.
      Parameters:
      signednessHint - true to default to a signed value, false to default to an unsigned value
      Returns:
      the value, forcing the signedness of ambiguous values using the specified hint
    • toString

      public String toString()
      Overrides:
      toString in class Scalar