Class GoFunctionMultiReturn
java.lang.Object
ghidra.app.util.bin.format.golang.GoFunctionMultiReturn
Handles creating a Ghidra structure to represent multiple return values returned from a golang
function.
Assigning custom storage for the return value is complicated by:
- golang storage allocations depend on the formal ordering of the return values
- stack storage must be last in a list of varnodes
- the decompiler maps a structure's contents to the list of varnodes in an endian-dependent manner.
To allow this artificial structure to adjusted by the user and reused at some later time to re-calculate the correct storage, the items in the structure are tagged with the original ordinal of that item as a text comment of each structure field, so that the correct ordering of items can be re-created when needed.
If the structure layout is modified to conform to an arch's requirements, the structure's name will be modified to include that arch's description at the end (eg. "_x86_64")
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGoFunctionMultiReturn
(CategoryPath categoryPath, String funcName, List<DataType> types, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) GoFunctionMultiReturn
(Structure struct, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) GoFunctionMultiReturn
(List<DWARFVariable> returnParams, DWARFFunction dfunc, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) -
Method Summary
Modifier and TypeMethodDescriptionstatic GoFunctionMultiReturn
fromStructure
(DataType dt, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) static boolean
-
Field Details
-
MULTIVALUE_RETURNTYPE_SUFFIX
- See Also:
-
-
Constructor Details
-
GoFunctionMultiReturn
public GoFunctionMultiReturn(List<DWARFVariable> returnParams, DWARFFunction dfunc, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) -
GoFunctionMultiReturn
public GoFunctionMultiReturn(CategoryPath categoryPath, String funcName, List<DataType> types, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) -
GoFunctionMultiReturn
public GoFunctionMultiReturn(Structure struct, DataTypeManager dtm, GoParamStorageAllocator storageAllocator)
-
-
Method Details
-
isMultiReturnDataType
-
fromStructure
public static GoFunctionMultiReturn fromStructure(DataType dt, DataTypeManager dtm, GoParamStorageAllocator storageAllocator) -
getStruct
-
getNormalStorageComponents
-
getStackStorageComponents
-