Package ghidra.app.util.bin.format.golang.rtti.types

# Class GoStructType

java.lang.Object
ghidra.app.util.bin.format.golang.rtti.types.GoType
ghidra.app.util.bin.format.golang.rtti.types.GoStructType

All Implemented Interfaces:
  `StructureMarkup<GoType>`, `StructureVerifier`

public class GoStructType extends GoType
Go type information about a specific structure type.

- ## Field Summary

  ### Fields inherited from class ghidra.app.util.bin.format.golang.rtti.types.GoType

  `context, programContext, typ, uncommonType`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GoStructType()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `additionalMarkup(MarkupSession session)`
  Called to allow the implementor to perform custom markup of itself.
  `boolean`
  `discoverGoTypes(Set<Long> discoveredTypes)`
  Iterates this type, and any types this type refers to, while registering the types with the `GoRttiMapper` context.
  `long`
  `getEndOfTypeInfo()`
  Returns the location of where this type object, and any known associated optional structures ends.
  `List<GoStructField>`
  `getFields()`
  Returns the fields defined by this struct type.
  `String`
  `getPackagePathString()`
  Returns the package path of this structure type
  `GoName`
  `getPkgPath()`
  Returns the package path of this structure type.
  `String`
  `getTypeDeclString()`
  Returns a descriptive string that defines the declaration of this type.
  `boolean`
  `isClosureContextType()`
  `boolean`
  `isMethodWrapperContextType()`
  `boolean`
  `isValid()`
  `DataType`
  `recoverDataType()`
  Converts a Go RTTI type structure into a Ghidra data type.

  ### Methods inherited from class ghidra.app.util.bin.format.golang.rtti.types.GoType

  `getBaseType, getDebugId, getFullyQualifiedName, getImplementsInterfaceString, getMethodInfoList, getMethodListString, getMethodPrototypeString, getMethodPrototypeString, getName, getOffsetEndOfFullType, getSpecializedTypeClass, getStructureContext, getStructureLabel, getStructureName, getStructureNamespace, getSymbolName, getTypeOffset, getUncommonType, toString`

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

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

  ### Methods inherited from interface ghidra.app.util.bin.format.golang.structmapping.StructureMarkup

  `getExternalInstancesToMarkup`

- ## Constructor Details

  - ### GoStructType

    public GoStructType()

- ## Method Details

  - ### getPkgPath

    public GoName getPkgPath() throws IOException
    Returns the package path of this structure type.
    Returns:
      the package path of this structure type
    Throws:
      `IOException` - if error reading

  - ### getPackagePathString

    public String getPackagePathString()
    Returns the package path of this structure type
    Overrides:
      `getPackagePathString` in class `GoType`
    Returns:
      package path of this structure type, as a string

  - ### getFields

    public List<GoStructField> getFields() throws IOException
    Returns the fields defined by this struct type.
    Returns:
      the fields defined by this struct type
    Throws:
      `IOException` - if error reading

  - ### getEndOfTypeInfo

    public long getEndOfTypeInfo() throws IOException
    Description copied from class: `GoType`
    Returns the location of where this type object, and any known associated optional structures ends.
    Overrides:
      `getEndOfTypeInfo` in class `GoType`
    Returns:
      index location of end of this type object
    Throws:
      `IOException` - if error reading

  - ### additionalMarkup

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

  - ### getTypeDeclString

    public String getTypeDeclString() throws IOException
    Description copied from class: `GoType`
    Returns a descriptive string that defines the declaration of this type.

    This method should be overloaded by more specific types.

    Overrides:
      `getTypeDeclString` in class `GoType`
    Returns:
      descriptive string
    Throws:
      `IOException` - if error reading data

  - ### recoverDataType

    public DataType recoverDataType() throws IOException
    Description copied from class: `GoType`
    Converts a Go 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`
    Returns:
      `DataType` that represents the Go 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`

  - ### isClosureContextType

    public boolean isClosureContextType()

  - ### isMethodWrapperContextType

    public boolean isMethodWrapperContextType()