java.lang.Object
ghidra.app.util.bin.format.golang.rtti.types.GoType
ghidra.app.util.bin.format.golang.rtti.types.GoPlainType
All Implemented Interfaces:
StructureMarkup<GoType>, StructureReader<GoType>, StructureVerifier

public class GoPlainType extends GoType implements StructureReader<GoType>
WARNING: tricky code / class layout here!

To coerce java inheritance and structmapping features to match the layout of go rtti type structs, this class is constructed strangely.

GoType structure that defines a built-in primitive type.

  • Constructor Details

    • GoPlainType

      public GoPlainType()
  • Method Details

    • readStructure

      public void readStructure() throws IOException
      Description copied from interface: StructureReader
      Called after an instance has been created and its context has been initialized, to give the struct a chance to deserialize itself using the BinaryReaders and such found in the context information.
      Specified by:
      readStructure in interface StructureReader<GoType>
      Throws:
      IOException - if error deserializing data for this struct
    • recoverDataType

      public DataType recoverDataType(GoTypeManager goTypes) throws IOException
      Description copied from class: GoType
      Converts a golang RTTI type structure into a Ghidra data type.

      This default implementation just creates an opaque blob of the appropriate size

      Overrides:
      recoverDataType in class GoType
      Parameters:
      goTypes - GoTypeManager
      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
      Description copied from class: GoType
      Iterates this type, and any types this type refers to, while registering the types with the GoRttiMapper context.

      This method should be overloaded by derived type classes to add any additional types referenced by the derived type.

      Overrides:
      discoverGoTypes in class GoType
      Parameters:
      discoveredTypes - set of already iterated types
      Returns:
      boolean boolean flag, if false the type has already been discovered, if true the type was encountered for the first time
      Throws:
      IOException - if error reading type info
    • isValid

      public boolean isValid()
      Specified by:
      isValid in interface StructureVerifier
      Overrides:
      isValid in class GoType