Package ghidra.program.model.symbol
Class RefTypeFactory
- java.lang.Object
-
- ghidra.program.model.symbol.RefTypeFactory
-
public class RefTypeFactory extends java.lang.Object
Factory class to create RefType objects.
-
-
Constructor Summary
Constructors Constructor Description RefTypeFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RefType
get(byte type)
Get static instance of the specified RefType/FlowTypestatic RefType[]
getDataRefTypes()
static FlowType
getDefaultComputedFlowType(Instruction instr)
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 statck 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[]
getExternalRefTypes()
static RefType[]
getMemoryRefTypes()
static RefType[]
getStackRefTypes()
-
-
-
Method Detail
-
getMemoryRefTypes
public static RefType[] getMemoryRefTypes()
-
getStackRefTypes
public static RefType[] getStackRefTypes()
-
getDataRefTypes
public static RefType[] getDataRefTypes()
-
getExternalRefTypes
public static RefType[] getExternalRefTypes()
-
get
public static RefType get(byte type)
Get static instance of the specified RefType/FlowType- Parameters:
type
- ref-type value- Returns:
- ref-type instance
- Throws:
java.util.NoSuchElementException
- if ref-type is not defined
-
getDefaultRegisterRefType
public static RefType getDefaultRegisterRefType(CodeUnit cu, Register reg, int opIndex)
Get the default statck data RefType for the specified code-unit/opIndex and register- Parameters:
cu
-reg
-opIndex
-- Returns:
- default RefType
-
getDefaultStackRefType
public static RefType getDefaultStackRefType(CodeUnit cu, int opIndex)
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
public static FlowType getDefaultComputedFlowType(Instruction instr)
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
-opIndex
-toAddr
- reference destinationignoreExistingReferences
- if true existing references will not influence default reference type returned.- Returns:
- default RefType
-
-