Class GoName
java.lang.Object
ghidra.app.util.bin.format.golang.rtti.GoName
- All Implemented Interfaces:
StructureMarkup<GoName>
,StructureReader<GoName>
Represents a golang "name" construct, which isn't represented in go as a normal structure
since it is full of variable length and optional fields.
struct { byte flag; varint strlen; char[strlen] chars; (optional: varint tag_strlen; char [tag_strlen];) (optional: int32 pkgpath) }Because this type has variable length fields (@FieldOutput(isVariableLength=true)), there will be unique structure data types produced for each size combination of a GoName structure, and will be named "GoName_N_M", where N and M are the lengths of the variable fields [name, tag]
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic GoName
createFakeInstance
(String fakeName) Create a GoName instance that supplies a specified name.int
getFlags()
Returns the flags found in this structure.Returns the flags found in this structure.Returns a descriptive string containing the full name value.getName()
Returns the name value.Returns the package path string, or null if not present.Returns the data type needed to store the pkg path offset field, called by serialization from the fieldoutput annotation.Returns the name of the instance, typically retrieved from data found inside the instance.getTag()
Returns the tag string.void
Called after an instance has been created and its context has been initialized.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
additionalMarkup, getExternalInstancesToMarkup, getStructureLabel, getStructureNamespace
-
Constructor Details
-
GoName
public GoName()
-
-
Method Details
-
readStructure
Description copied from interface:StructureReader
Called after an instance has been created and its context has been initialized.- Specified by:
readStructure
in interfaceStructureReader<GoName>
- Throws:
IOException
-
getName
Returns the name value.- Returns:
- name string
-
getTag
Returns the tag string.- Returns:
- tag string
-
getPkgPath
Returns the package path string, or null if not present.- Returns:
- package path string, or null if not present
- Throws:
IOException
- if error reading data
-
getPkgPathDataType
Returns the data type needed to store the pkg path offset field, called by serialization from the fieldoutput annotation.- Returns:
- Ghidra data type needed to store the pkg path offset field, or null if not present
-
getFullNameString
Returns a descriptive string containing the full name value.- Returns:
- descriptive string
-
getFlags
public int getFlags()Returns the flags found in this structure.- Returns:
- flags, as an int
-
getFlagsSet
Returns the flags found in this structure.- Returns:
- flags, as a set of
GoName.Flag
enum values
-
getStructureContext
- Specified by:
getStructureContext
in interfaceStructureMarkup<GoName>
-
getStructureName
Description copied from interface:StructureMarkup
Returns the name of the instance, typically retrieved from data found inside the instance.- Specified by:
getStructureName
in interfaceStructureMarkup<GoName>
- Returns:
- string name, or null if this instance does not have a name
- Throws:
IOException
- if error getting name
-
toString
-
createFakeInstance
Create a GoName instance that supplies a specified name.- Parameters:
fakeName
- string name to return from the GoName's getName()- Returns:
- new GoName instance that can only be used to call getName()
-