Package ghidra.program.database.data

# Class PointerTypedefInspector

java.lang.Object
ghidra.program.database.data.PointerTypedefInspector

public class PointerTypedefInspector extends Object
`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 Type
  Method
  Description
  `static 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 (see `PointerType`).
  `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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getPointerComponentOffset

    public static long getPointerComponentOffset(TypeDef pointerTypeDef)
    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 TypeDef
      `addrFactory` - target address factory
    Returns:
      referenced address space or null if not specified or address space lookup fails.

  - ### hasPointerBitShift

    public static boolean hasPointerBitShift(TypeDef pointerTypeDef)
    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

    public static long getPointerBitShift(TypeDef pointerTypeDef)
    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

    public static boolean hasPointerBitMask(TypeDef pointerTypeDef)
    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

    public static long getPointerBitMask(TypeDef pointerTypeDef)
    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

    public static PointerType getPointerType(TypeDef pointerTypeDef)
    Get the pointer type (see `PointerType`).
    Parameters:
      `pointerTypeDef` - Pointer TypeDef
    Returns:
      pointer type or null if not a pointer