Class UnionFacetSymbol
java.lang.Object
ghidra.program.model.pcode.HighSymbol
ghidra.program.model.pcode.UnionFacetSymbol
A specialized HighSymbol that directs the decompiler to use a specific field of a union,
when interpreting a particular PcodeOp that accesses a Varnode whose data-type involves the
union. The symbol is stored as a dynamic variable annotation. The data-type must either be the
union itself or a pointer to the union. The firstUseOffset and dynamic hash
identify the particular PcodeOp and Varnode affected. The field number is the ordinal
of the desired field (DataTypeComponent) within the union. It is currently stored by
encoding it in the symbol name.
-
Field Summary
FieldsFields inherited from class HighSymbol
category, categoryIndex, dtmanage, entryList, function, ID_BASE, name, type -
Constructor Summary
ConstructorsChangeConstructorDescriptionUnionFacetSymbol(long uniqueId, String nm, DataType dt, HighFunction func) -
Method Summary
ChangeModifier and TypeMethodDescriptionstatic StringbuildSymbolName(int fldNum, Address addr, boolean isAddr) Generate an automatic symbol name, given a field number and addressvoidEncode the symbol description as an element to the stream.static booleanFirst character of 'a' after BASENAME indicates an address based facetstatic intThe actual field number is encoded in the symbol namestatic booleanisUnionType(DataType dt) Return true if the given data-type is either a union or a pointer to a union and is suitable for being the data-type of UnionFacetSymbolREMOVEDStringbuildSymbolName(int fldNum, Address addr) RemovedMethods inherited from class HighSymbol
addMapEntry, decode, decodeHeader, decodeMapSym, encodeHeader, encodeMapSym, getCategoryIndex, getDataType, getFirstUseOffset, getFirstWholeMap, getHighFunction, getHighVariable, getId, getMutability, getName, getNamespace, getPCAddress, getProgram, getSize, getStorage, getSymbol, isGlobal, isHiddenReturn, isIsolated, isNameLocked, isParameter, isThisPointer, isTypeLocked, resolveStorage, setCategory, setNameLock, setTypeLock
-
Field Details
-
BASENAME
-
-
Constructor Details
-
UnionFacetSymbol
-
-
Method Details
-
encode
Description copied from class:HighSymbolEncode the symbol description as an element to the stream. This does NOT save the mappings.- Overrides:
encodein classHighSymbol- Parameters:
encoder- is the stream encoder- Throws:
IOException- for errors in the underlying stream
-
buildSymbolName NEW
-
extractFieldNumber
The actual field number is encoded in the symbol name- Parameters:
nm- is the symbol name- Returns:
- the field number or -1 if we cannot parse
-
extractAddressBased NEW
First character of 'a' after BASENAME indicates an address based facet- Parameters:
nm- is the symbol name- Returns:
- true if the facet is address based
-
isUnionType
Return true if the given data-type is either a union or a pointer to a union and is suitable for being the data-type of UnionFacetSymbol- Parameters:
dt- is the given data-type- Returns:
- true if the data-type is a union or a pointer to a union
-