Package ghidra.program.model.pcode
Class HighFunctionDBUtil
- java.lang.Object
- 
- ghidra.program.model.pcode.HighFunctionDBUtil
 
- 
 public class HighFunctionDBUtil extends java.lang.ObjectHighFunctionDBUtilprovides various methods for updating the state of a function contained within a program database. It is important to note that the decompiler result state (e.g., HighFunction, HighParam, HighLocal, etc.) is not altered by any of these methods. A new decompiler result will need to be generated to reflect any changes made to the database. Care must be taken when making incremental changes to multiple elements (e.g., Variables)
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringAUTO_CAT
 - 
Constructor SummaryConstructors Constructor Description HighFunctionDBUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcommitLocalsToDatabase(HighFunction highFunction, SourceType source)Commit all local variables to the underlying database.static voidcommitParamsToDatabase(Function function, FunctionPrototype prototype, java.util.List<Parameter> params, boolean hasVarArgs, boolean renameConflicts, SourceType source)Commit the specified parameter list to the specified function.static voidcommitParamsToDatabase(HighFunction highFunction, boolean useDataTypes, SourceType source)Commit all parameters associated with HighFunction to the underlying database.static voidcommitReturnToDatabase(HighFunction highFunction, SourceType source)Commit function return to the underlying database.static DataTypeSymbolreadOverride(Symbol sym)Read a call prototype override which corresponds to the specified override code symbolstatic voidupdateDBVariable(HighVariable variable, java.lang.String name, DataType dataType, SourceType source)Retype the specified variable in the database.static voidwriteOverride(Function function, Address callsite, FunctionSignature sig)Commit an override of a calls prototype to the database
 
- 
- 
- 
Field Detail- 
AUTO_CATpublic static final java.lang.String AUTO_CAT - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
commitReturnToDatabasepublic static void commitReturnToDatabase(HighFunction highFunction, SourceType source) Commit function return to the underlying database.- Parameters:
- highFunction-
 
 - 
commitParamsToDatabasepublic static void commitParamsToDatabase(HighFunction highFunction, boolean useDataTypes, SourceType source) throws DuplicateNameException, InvalidInputException Commit all parameters associated with HighFunction to the underlying database.- Parameters:
- highFunction- is the associated HighFunction
- useDataTypes- is true if the HighFunction's parameter data-types should be committed
- source- is the signature source type to set
- Throws:
- DuplicateNameException- if commit of parameters caused conflict with other local variable/label.
- InvalidInputException- if specified storage is invalid
 
 - 
commitParamsToDatabasepublic static void commitParamsToDatabase(Function function, FunctionPrototype prototype, java.util.List<Parameter> params, boolean hasVarArgs, boolean renameConflicts, SourceType source) throws DuplicateNameException, InvalidInputException Commit the specified parameter list to the specified function.- Parameters:
- function-
- params-
- renameConflicts- if true any name conflicts will be resolved by renaming the conflicting local variable/label
- source- source type
- Throws:
- DuplicateNameException- if commit of parameters caused conflict with other local variable/label. Should not occur if renameConflicts is true.
- InvalidInputException
 
 - 
commitLocalsToDatabasepublic static void commitLocalsToDatabase(HighFunction highFunction, SourceType source) Commit all local variables to the underlying database.- Parameters:
- highFunction-
- source- source type
 
 - 
updateDBVariablepublic static void updateDBVariable(HighVariable variable, java.lang.String name, DataType dataType, SourceType source) throws InvalidInputException, DuplicateNameException Retype the specified variable in the database. All parameters may be flushed to the database if typed parameter inconsistency detected. Only variable types HighParam, HighLocal and HighGlobal are supported.- Parameters:
- variable-
- name- new variable name or null to use retain current variable name
- dataType- newly assigned data type or null to retain current variable datatype. Only a fixed-length data type may be specified. If size varies from the current size, an attempt will be made to grow/shrink the storage.
- source- source type
- Throws:
- InvalidInputException- if suitable data type was not specified, or unable to resize storage, or invalid name specified
- DuplicateNameException- if name was specified and conflicts with another variable/label within the function's namespace
- java.lang.UnsupportedOperationException- if unsupported variable type is specified
 
 - 
writeOverridepublic static void writeOverride(Function function, Address callsite, FunctionSignature sig) throws InvalidInputException, DuplicateNameException Commit an override of a calls prototype to the database- Parameters:
- func- is the Function whose call is being overriden
- callsite- is the address of the call
- function- signature override
- Throws:
- InvalidInputException
- DuplicateNameException
 
 - 
readOverridepublic static DataTypeSymbol readOverride(Symbol sym) Read a call prototype override which corresponds to the specified override code symbol- Parameters:
- sym- special call override code symbol whose address corresponds to a callsite
- Returns:
- call prototype override DataTypeSymbol or null if associated function signature datatype could not be found
 
 
- 
 
-