Package ghidra.program.database.data
Class PointerTypedefInspector
java.lang.Object
ghidra.program.database.data.PointerTypedefInspector
PointerTypeDefInspector
provides utilities for inspecting Pointer
- TypeDef
s.
These special typedefs allow a modified-pointer datatype to be used for special situations where
a simple pointer will not suffice and special stored pointer interpretation/handling is required.
The various
Pointer
modifiers on the associated TypeDef
are achieved through the use of various
TypeDefSettingsDefinition
. The PointerTypedefBuilder
may be used to simplify the creation
of these pointer-typedefs.-
Method Summary
Modifier and TypeMethodDescriptionstatic AddressSpace
getPointerAddressSpace
(TypeDef pointerTypeDef, AddressFactory addrFactory) Determine the referenced address space for specified pointerTypeDef based upon its default settings.static long
getPointerBitMask
(TypeDef pointerTypeDef) Determine the pointer bit-mask for the specified pointerTypeDef based upon its default settings.static long
getPointerBitShift
(TypeDef pointerTypeDef) Determine the pointer bit-shift for the specified pointerTypeDef based upon its default settings.static long
getPointerComponentOffset
(TypeDef pointerTypeDef) Determine the component-offset for the specified pointerTypeDef based upon its default settings.static PointerType
getPointerType
(TypeDef pointerTypeDef) Get the pointer type (seePointerType
).static boolean
hasPointerBitMask
(TypeDef pointerTypeDef) Determine if the specified pointerTypeDef has a pointer bit-mask specified.static boolean
hasPointerBitShift
(TypeDef pointerTypeDef) Determine if the specified pointerTypeDef has a pointer bit-shift specified.
-
Method Details
-
getPointerComponentOffset
Determine the component-offset for the specified pointerTypeDef based upon its default settings.- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- pointer component offset or 0 if unspecified or not applicable
-
getPointerAddressSpace
public static AddressSpace getPointerAddressSpace(TypeDef pointerTypeDef, AddressFactory addrFactory) Determine the referenced address space for specified pointerTypeDef based upon its default settings.- Parameters:
pointerTypeDef
- Pointer TypeDefaddrFactory
- target address factory- Returns:
- referenced address space or null if not specified or address space lookup fails.
-
hasPointerBitShift
Determine if the specified pointerTypeDef has a pointer bit-shift specified.- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- true if non-zero bit-shift setting exists, else false
-
getPointerBitShift
Determine the pointer bit-shift for the specified pointerTypeDef based upon its default settings. A right-shift is specified by a positive value while a left-shift is specified by a negative value. If specified, bit-shift will be applied after applying any specified bit-mask.- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- pointer bit-shift or 0 if unspecified or not applicable
-
hasPointerBitMask
Determine if the specified pointerTypeDef has a pointer bit-mask specified.- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- true if a bit-mask setting exists, else false
-
getPointerBitMask
Determine the pointer bit-mask for the specified pointerTypeDef based upon its default settings. If specified, bit-mask will be AND-ed with stored offset prior to any specified bit-shift.- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- pointer bit-shift or 0 if unspecified or not applicable
-
getPointerType
Get the pointer type (seePointerType
).- Parameters:
pointerTypeDef
- Pointer TypeDef- Returns:
- pointer type or null if not a pointer
-