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

# Class GolangDWARFFunctionFixup

java.lang.Object
ghidra.app.util.bin.format.golang.GolangDWARFFunctionFixup

All Implemented Interfaces:
  `DWARFFunctionFixup`, `ExtensionPoint`

public class GolangDWARFFunctionFixup extends Object implements DWARFFunctionFixup
Fixups for golang functions found during DWARF processing.

Fixes storage of parameters to match the go callspec and modifies parameter lists to match Ghidra's capabilities.

Special characters used by golang in symbol names (middle dot ·, weird slash ∕) are fixed up in DWARFProgram.getDWARFNameInfo() by calling GoSymbolName.fixGolangSpecialSymbolnameChars().

Go's 'unique' usage of DW_TAG_subroutine_type to define its ptr-to-ptr-to-func is handled in DWARFDataTypeImporter.makeDataTypeForFunctionDefinition().

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final CategoryPath`
  `GOLANG_API_EXPORT`

  ### Fields inherited from interface ghidra.app.util.bin.format.dwarf4.funcfixup.DWARFFunctionFixup

  `PRIORITY_LAST, PRIORITY_NORMAL, PRIORITY_NORMAL_EARLY, PRIORITY_NORMAL_LATE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GolangDWARFFunctionFixup()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `fixupDWARFFunction(DWARFFunction dfunc)`
  Called before a `DWARFFunction` is used to create a Ghidra Function.
  `static boolean`
  `isGolangFunction(DWARFFunction dfunc)`
  Returns true if the specified `DWARFFunction` wrapper refers to a function in a golang compile unit.

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

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

- ## Field Details

  - ### GOLANG_API_EXPORT

    public static final CategoryPath GOLANG_API_EXPORT

- ## Constructor Details

  - ### GolangDWARFFunctionFixup

    public GolangDWARFFunctionFixup()

- ## Method Details

  - ### isGolangFunction

    public static boolean isGolangFunction(DWARFFunction dfunc)
    Returns true if the specified `DWARFFunction` wrapper refers to a function in a golang compile unit.
    Parameters:
      `dfunc` - `DWARFFunction`
    Returns:
      boolean true or false

  - ### fixupDWARFFunction

    public void fixupDWARFFunction(DWARFFunction dfunc) throws DWARFException
    Description copied from interface: `DWARFFunctionFixup`
    Called before a `DWARFFunction` is used to create a Ghidra Function.

    If processing of the function should terminate (and the function be skipped), throw a `DWARFException`.

    Specified by:
      `fixupDWARFFunction` in interface `DWARFFunctionFixup`
    Parameters:
      `dfunc` - `DWARFFunction` info read from DWARF about the function
    Throws:
      `DWARFException`