Package ghidra.program.model.symbol
Class RefTypeFactory
java.lang.Object
ghidra.program.model.symbol.RefTypeFactory
Factory class to create RefType objects.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RefType
get
(byte type) Get static instance of the specified RefType/FlowTypestatic RefType[]
static FlowType
Determine default computed FlowType for a specified instruction.static FlowType
getDefaultFlowType
(Instruction instr, Address toAddr, boolean allowComputedFlowType) Determine default FlowType for a specified instruction and flow destination toAddr.static RefType
getDefaultMemoryRefType
(CodeUnit cu, int opIndex, Address toAddr, boolean ignoreExistingReferences) Get the default memory flow/data RefType for the specified code unit and opIndex.static RefType
getDefaultRegisterRefType
(CodeUnit cu, Register reg, int opIndex) Get the default stack data RefType for the specified code-unit/opIndex and registerstatic RefType
getDefaultStackRefType
(CodeUnit cu, int opIndex) Get the default register data RefType for the specified code-unit/opIndex and registerstatic RefType[]
static RefType[]
static RefType[]
-
Constructor Details
-
RefTypeFactory
public RefTypeFactory()
-
-
Method Details
-
getMemoryRefTypes
-
getStackRefTypes
-
getDataRefTypes
-
getExternalRefTypes
-
get
Get static instance of the specified RefType/FlowType- Parameters:
type
- ref-type value- Returns:
- ref-type instance
- Throws:
NoSuchElementException
- if ref-type is not defined
-
getDefaultRegisterRefType
Get the default stack data RefType for the specified code-unit/opIndex and register- Parameters:
cu
- the code unitreg
- the registeropIndex
- the op index- Returns:
- default RefType
-
getDefaultStackRefType
Get the default register data RefType for the specified code-unit/opIndex and register- Parameters:
cu
- the code unit to get the default stack ref type.opIndex
- the operand index.- Returns:
- the default register datat refType.
-
getDefaultFlowType
public static FlowType getDefaultFlowType(Instruction instr, Address toAddr, boolean allowComputedFlowType) Determine default FlowType for a specified instruction and flow destination toAddr.- Parameters:
instr
- instructiontoAddr
- flow destination addressallowComputedFlowType
- if true and an absolute flow type is not found a computed flow type will be returned if only one exists.- Returns:
- FlowType or null if unable to determine
-
getDefaultComputedFlowType
Determine default computed FlowType for a specified instruction. It is assumed that all computed flows utilize a register in its destination specification/computation.- Parameters:
instr
- instruction- Returns:
- FlowType or null if unable to determine
-
getDefaultMemoryRefType
public static RefType getDefaultMemoryRefType(CodeUnit cu, int opIndex, Address toAddr, boolean ignoreExistingReferences) Get the default memory flow/data RefType for the specified code unit and opIndex.- Parameters:
cu
- the code unitopIndex
- the op indextoAddr
- reference destinationignoreExistingReferences
- if true existing references will not influence default reference type returned.- Returns:
- default RefType
-