Record Class GoSymbolName
java.lang.Object
java.lang.Record
ghidra.app.util.bin.format.golang.rtti.GoSymbolName
- Record Components:
symbolName
- full name of the golang symbolpackagePath
- portion the symbol name that is the packagePath (path+packagename), or nullpackageName
- portion of the symbol name that is the package name, or nullreceiverString
- portion of the symbol name that is the receiver string (only found when the receiver is in the form of "(*typename)"), or null
public record GoSymbolName(String symbolName, String packagePath, String packageName, String receiverString)
extends Record
Represents a Golang symbol name.
-
Constructor Summary
ConstructorDescriptionGoSymbolName
(String symbolName, String packagePath, String packageName, String receiverString) Creates an instance of aGoSymbolName
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static String
Fixes the specified string if it contains any of the golang special symbolname characters: middle-dot and the weird slash.static GoSymbolName
Constructs a minimal GoSymbolName instance from the supplied values.static GoSymbolName
fromPackagePath
(String packagePath) Constructs a GoSymbolName instance that only has a package path / package name.getFunction
(Program program) Returns the matching Ghidra function (based on namespace and symbol name).Returns portion of the symbol name that is the package name, or nullReturns the portion the symbol name that is the packagePath (path+packagename), or nullReturns portion of the symbol name that is the receiver string (only found when the receiver is in the form of "(*typename)"), or nullReturns the full name of the golang symbolgetSymbolNamespace
(Program program) Returns a GhidraNamespace
based on the golang package path.Returns the portion of the package path before the package name, eg.final int
hashCode()
Returns a hash code value for this object.Returns the value of thepackageName
record component.Returns the value of thepackagePath
record component.static GoSymbolName
Parses a golang symbol string and returns a GoSymbolName instance.Returns the value of thereceiverString
record component.Returns the value of thesymbolName
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
GoSymbolName
public GoSymbolName(String symbolName, String packagePath, String packageName, String receiverString) Creates an instance of aGoSymbolName
record class.- Parameters:
symbolName
- the value for thesymbolName
record componentpackagePath
- the value for thepackagePath
record componentpackageName
- the value for thepackageName
record componentreceiverString
- the value for thereceiverString
record component
-
-
Method Details
-
fixGolangSpecialSymbolnameChars
Fixes the specified string if it contains any of the golang special symbolname characters: middle-dot and the weird slash.- Parameters:
s
- string to fix- Returns:
- original string, or fixed version
-
parse
Parses a golang symbol string and returns a GoSymbolName instance.- Parameters:
s
- string to parse- Returns:
- new GoSymbolName instance, never null
-
from
Constructs a minimal GoSymbolName instance from the supplied values.- Parameters:
packageName
- package name, does not handle package paths, eg. "runtime"symbolName
- full symbol name, eg. "runtime.foo"- Returns:
- new GoSymbolName instance
-
fromPackagePath
Constructs a GoSymbolName instance that only has a package path / package name.- Parameters:
packagePath
- package path to parse- Returns:
- GoSymbolName that only has a package path and package name value
-
getPackagePath
Returns the portion the symbol name that is the packagePath (path+packagename), or null- Returns:
- the portion the symbol name that is the packagePath (path+packagename), or null
-
getPackageName
Returns portion of the symbol name that is the package name, or null- Returns:
- portion of the symbol name that is the package name, or null
-
getRecieverString
Returns portion of the symbol name that is the receiver string (only found when the receiver is in the form of "(*typename)"), or null- Returns:
- portion of the symbol name that is the receiver string (only found when the receiver is in the form of "(*typename)"), or null
-
getSymbolName
Returns the full name of the golang symbol- Returns:
- full name of the golang symbol
-
getTruncatedPackagePath
Returns the portion of the package path before the package name, eg. "internal/sys" would become "internal/".- Returns:
- package path, without the trailing package name, or empty string if there is no path portion of the string
-
getSymbolNamespace
Returns a GhidraNamespace
based on the golang package path. -
getFunction
Returns the matching Ghidra function (based on namespace and symbol name). -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
symbolName
Returns the value of thesymbolName
record component.- Returns:
- the value of the
symbolName
record component
-
packagePath
Returns the value of thepackagePath
record component.- Returns:
- the value of the
packagePath
record component
-
packageName
Returns the value of thepackageName
record component.- Returns:
- the value of the
packageName
record component
-
receiverString
Returns the value of thereceiverString
record component.- Returns:
- the value of the
receiverString
record component
-