Class DWARFNumericAttribute
java.lang.Object
ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeValue
ghidra.app.util.bin.format.dwarf.attribs.DWARFNumericAttribute
- Direct Known Subclasses:
DWARFIndirectAttribute
DWARF numeric attribute.
-
Field Summary
Fields inherited from class ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeValue
def
-
Constructor Summary
ConstructorDescriptionDWARFNumericAttribute
(int bitLength, long value, boolean signed, boolean ambiguous, DWARFAttributeDef<?> def) Creates a new numeric value, using the specific bitLength and value.DWARFNumericAttribute
(int bitLength, long value, boolean signed, DWARFAttributeDef<?> def) Creates a new numeric value, using the specific bitLength and value.DWARFNumericAttribute
(long value, DWARFAttributeDef<?> def) Creates a new numeric value, using 64 bits and marked as signed -
Method Summary
Modifier and TypeMethodDescriptionint
long
long
getValue()
long
getValueWithSignednessHint
(boolean signednessHint) Returns the value, forcing the signedness of ambiguous values using the specified hint.boolean
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.boolean
toElementLocationString
(String elementType, String sectionName, int index, long offset, int ver) toString()
Methods inherited from class ghidra.app.util.bin.format.dwarf.attribs.DWARFAttributeValue
getAttributeForm, getAttributeName
-
Constructor Details
-
DWARFNumericAttribute
Creates a new numeric value, using 64 bits and marked as signed- Parameters:
value
- long 64 bit valuedef
- attribute id and form of this value
-
DWARFNumericAttribute
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 0value
- value of the scalar, any bits that are set above bitLength will be ignoredsigned
- true for a signed value, false for an unsigned value.def
- attribute id and form of this value
-
DWARFNumericAttribute
public DWARFNumericAttribute(int bitLength, long value, boolean signed, boolean ambiguous, DWARFAttributeDef<?> def) 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 0value
- value of the scalar, any bits that are set above bitLength will be ignoredsigned
- 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 thesigned
parameter is known to be correctdef
- attribute id and form of this value
-
-
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
-
isHighbitSet
public boolean isHighbitSet() -
getValue
public long getValue() -
getUnsignedValue
public long getUnsignedValue() -
getUnsignedIntExact
- Throws:
IOException
-
toElementLocationString
-
toString
- Overrides:
toString
in classDWARFAttributeValue
-
toString
-