Class DWARFFunction

java.lang.Object
ghidra.app.util.bin.format.dwarf.DWARFFunction

public class DWARFFunction extends Object
Represents a function that was read from DWARF information.
  • Field Details Link icon

  • Method Details Link icon

    • read Link icon

      Create a function instance from the information found in the specified DIEA.
      Parameters:
      diea - DW_TAG_subprogram DIEAggregate
      Returns:
      new DWARFFunction, or null if invalid DWARF information
      Throws:
      IOException - if error accessing attribute values
      DWARFExpressionException - if error accessing attribute values
    • getProgram Link icon

      public DWARFProgram getProgram()
    • getDescriptiveName Link icon

      public String getDescriptiveName()
    • getRangeList Link icon

      public DWARFRangeList getRangeList()
    • getCallingConventionName Link icon

      public String getCallingConventionName()
    • getBody Link icon

      public AddressSetView getBody()
    • getEntryPc Link icon

      public long getEntryPc()
    • getLocalVarByOffset Link icon

      public DWARFVariable getLocalVarByOffset(long offset)
      Returns the DWARFVariable that starts at the specified stack offset.
      Parameters:
      offset - stack offset
      Returns:
      local variable that starts at offset, or null if not present
    • isInLocalVarStorageArea Link icon

      public boolean isInLocalVarStorageArea(long offset)
      Returns true if the specified stack offset is within the function's local variable storage area.
      Parameters:
      offset - stack offset to test
      Returns:
      true if stack offset is within this function's local variable area
    • hasConflictWithParamStorage Link icon

      public boolean hasConflictWithParamStorage(DWARFVariable dvar) throws InvalidInputException
      Throws:
      InvalidInputException
    • hasConflictWithExistingLocalVariableStorage Link icon

      public boolean hasConflictWithExistingLocalVariableStorage(DWARFVariable dvar) throws InvalidInputException
      Throws:
      InvalidInputException
    • getAllParamNames Link icon

      public List<String> getAllParamNames()
    • getAllLocalVariableNames Link icon

      public List<String> getAllLocalVariableNames()
    • getExistingLocalVariableNames Link icon

      public List<String> getExistingLocalVariableNames()
    • getNonParamSymbolNames Link icon

      public List<String> getNonParamSymbolNames()
    • getParameters Link icon

      public List<Parameter> getParameters(boolean includeStorageDetail) throws InvalidInputException
      Returns this function's parameters as a list of Parameter instances.
      Parameters:
      includeStorageDetail - boolean flag, if true storage information will be included, if false, VariableStorage.UNASSIGNED_STORAGE will be used
      Returns:
      list of Parameters
      Throws:
      InvalidInputException - if bad information in param storage
    • getParameterDefinitions Link icon

      public ParameterDefinition[] getParameterDefinitions()
      Returns the parameters of this function as ParameterDefinitions.
      Returns:
      array of ParameterDefinitions
    • commitLocalVariable Link icon

      public void commitLocalVariable(DWARFVariable dvar)
    • getFuncBody Link icon

      public static AddressRange getFuncBody(DIEAggregate diea, boolean flattenDisjoint) throws IOException
      Throws:
      IOException
    • getFuncBodyRanges Link icon

      public static DWARFRangeList getFuncBodyRanges(DIEAggregate diea) throws IOException
      Throws:
      IOException
    • syncWithExistingGhidraFunction Link icon

      public boolean syncWithExistingGhidraFunction(boolean createIfMissing)
    • runFixups Link icon

      public void runFixups()
    • updateFunctionSignature Link icon

      public void updateFunctionSignature()
    • asFunctionDefinition Link icon

      public FunctionDefinition asFunctionDefinition(boolean includeCC)
      Returns a FunctionDefinition that reflects this function's information.
      Parameters:
      includeCC - boolean flag, if true the returned funcdef will include calling convention
      Returns:
      FunctionDefinition that reflects this function's information
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object