java.lang.Object
ghidra.app.util.bin.format.golang.rtti.types.GoType
All Implemented Interfaces:
StructureMarkup<GoType>
Direct Known Subclasses:
GoArrayType, GoChanType, GoFuncType, GoInterfaceType, GoMapType, GoPlainType, GoPointerType, GoSliceType, GoStructType

public abstract class GoType extends Object implements StructureMarkup<GoType>
Common abstract base class for GoType classes
  • Field Details

  • Constructor Details

    • GoType

      public GoType()
  • Method Details

    • getSpecializedTypeClass

      public static Class<? extends GoType> getSpecializedTypeClass(GoRttiMapper programContext, long offset) throws IOException
      Returns the specific GoType derived class that will handle the go type located at the specified offset.
      Parameters:
      programContext - program-level mapper context
      offset - absolute location of go type struct
      Returns:
      GoType class that will best handle the type struct
      Throws:
      IOException - if error reading
    • getBaseType

      protected GoBaseType getBaseType()
    • getNameString

      public String getNameString() throws IOException
      Throws:
      IOException
    • getDebugId

      public String getDebugId()
    • getOffsetEndOfFullType

      protected long getOffsetEndOfFullType()
    • getEndOfTypeInfo

      public long getEndOfTypeInfo() throws IOException
      Returns the location of where this type object, and any known associated optional structures ends.
      Returns:
      index location of end of this type object
      Throws:
      IOException - if error reading
    • getUncommonType

      public GoUncommonType getUncommonType() throws IOException
      Throws:
      IOException
    • getStructureContext

      public StructureContext<GoType> getStructureContext()
      Specified by:
      getStructureContext in interface StructureMarkup<GoType>
    • getStructureName

      public String getStructureName() throws IOException
      Description copied from interface: StructureMarkup
      Returns the name of the instance, typically retrieved from data found inside the instance.
      Specified by:
      getStructureName in interface StructureMarkup<GoType>
      Returns:
      string name, or null if this instance does not have a name
      Throws:
      IOException - if error getting name
    • additionalMarkup

      public void additionalMarkup(MarkupSession session) throws IOException
      Description copied from interface: StructureMarkup
      Called to allow the implementor to perform custom markup of itself.
      Specified by:
      additionalMarkup in interface StructureMarkup<GoType>
      Parameters:
      session - state and methods to assist marking up the program
      Throws:
      IOException - if error during markup
    • getMethodListString

      public String getMethodListString() throws IOException
      Throws:
      IOException
    • getTypeDeclString

      protected String getTypeDeclString() throws IOException
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • recoverDataType

      public DataType recoverDataType() throws IOException
      Converts a golang RTTI type structure into a Ghidra data type.
      Returns:
      DataType that represents the golang type
      Throws:
      IOException - if error getting name of the type
    • discoverGoTypes

      public boolean discoverGoTypes(Set<Long> discoveredTypes) throws IOException
      Throws:
      IOException