Package ghidra.program.database.function
Class FunctionDB
java.lang.Object
ghidra.program.database.DatabaseObject
ghidra.program.database.function.FunctionDB
Database implementation of a Function.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ghidra.program.model.listing.Function
Function.FunctionUpdateType -
Field Summary
Fields inherited from class ghidra.program.database.DatabaseObject
keyFields inherited from interface ghidra.program.model.listing.Function
DEFAULT_CALLING_CONVENTION_STRING, DEFAULT_LOCAL_PREFIX, DEFAULT_LOCAL_PREFIX_LEN, DEFAULT_LOCAL_RESERVED_PREFIX, DEFAULT_LOCAL_TEMP_PREFIX, DEFAULT_PARAM_PREFIX, DEFAULT_PARAM_PREFIX_LEN, INLINE, INVALID_STACK_DEPTH_CHANGE, NORETURN, RETURN_PTR_PARAM_NAME, THIS_PARAM_NAME, THUNK, UNKNOWN_CALLING_CONVENTION_STRING, UNKNOWN_STACK_DEPTH_CHANGEFields inherited from interface ghidra.program.model.symbol.Namespace
DELIMITER, GLOBAL_NAMESPACE_ID, NAMESPACE_DELIMITER -
Method Summary
Modifier and TypeMethodDescriptionaddLocalVariable(Variable var, SourceType source) Adds a local variable to the function.addParameter(Variable var, SourceType source) Adds the given variable to the end of the parameters list.booleanAdds the tag with the given name to this function; if one does not exist, one is created.protected voidChecks if this object has been deleted, in which case any use of the object is not allowed.voiddoDeleteVariable(VariableSymbolDB symbol) Callback to remove variable just prior to removal of the underlying symbol.booleanVariable[]Returns an array of all local and parameter variablesintGets the number of auto-parameters for this function also included in the total count provided byFunction.getParameterCount().getBody()Get the address set for this namespace.getCalledFunctions(TaskMonitor monitor) Returns a set of functions that this function calls.Returns the current call-fixup name set on this instruction or null if one has not been setGets the calling convention prototype model for this function.Gets the calling convention's name for this function.getCallingFunctions(TaskMonitor monitor) Returns a set of functions that call this function.Get the comment for this function.String[]Returns the function (same as plate) comment as an array of strings where each item in the array is a line of text in the comment.Get the entry point for this function.Address[]getFunctionThunkAddresses(boolean recursive) If this function is "Thunked", an array of Thunk Function entry points is returned.longgetID()Return the namespace idVariable[]Get all local function variablesVariable[]getLocalVariables(VariableFilter filter) Get all local function variables which satisfy the specified filtergetName()Get the name of this function.getName(boolean includeNamespacePath) Returns the fully qualified namegetParameter(int ordinal) Returns the specified parameter including an auto-param at the specified ordinal.intGets the total number of parameters for this function.Get all function parametersgetParameters(VariableFilter filter) Get all function parameters which satisfy the specified filterGet the parent scope.Get the program containing this function.getPrototypeString(boolean formalSignature, boolean includeCallingConvention) Return a string representation of the function signatureReturns the repeatable comment for this function.String[]Returns the repeatable comment as an array of strings.Get the Function's return type/storage represented by a Parameter object.Get the Function's return type.Get the function's effective signature.getSignature(boolean formalSignature) Get the function's signature.Returns the source type for the overall signature excluding function name and parameter names whose source is carried by the corresponding symbol.Get the stack frame for this function.intGet the change in the stack pointer resulting from calling this function.Get the symbol for this namespace.getTags()Return allFunctionTagobjects associated with this function.getThunkedFunction(boolean recursive) If this function is a Thunk, this method returns the referenced function.getVariable(VariableSymbolDB symbol) Return the Variable for the given symbol.Variable[]getVariables(VariableFilter filter) Get all function variables which satisfy the specified filterbooleaninthashCode()booleanbooleanReturns true if this function has a variable argument list (VarArgs)ghidra.program.database.function.ParameterDBinsertParameter(int ordinal, Variable var, SourceType source) Inserts the given variable into the parameters list.booleanDetermine if this function object has been deleted.booleanReturns true if this namespace is external (i.e., associated with a Library)booleanisInline()booleancheck if stack purge size is valid.booleanisThunk()moveParameter(int fromOrdinal, int toOrdinal) Move the parameter which occupies the fromOrdinal position to the toOrdinal position.voidChanges all local user-defined labels for this function to global symbols.protected booleanrefresh()Tells the object to refresh its state from the database.protected booleanTells the object to refresh its state from the database using the specified record if not null.voidremoveParameter(int ordinal) Remove the specified parameter.voidRemoves the given tag from this function.voidremoveVariable(Variable variable) Removes the given variable from the function.voidreplaceParameters(Function.FunctionUpdateType updateType, boolean force, SourceType source, Variable... newParams) Replace all current parameters with the given list of parameters.voidreplaceParameters(List<? extends Variable> newParams, Function.FunctionUpdateType updateType, boolean force, SourceType source) Replace all current parameters with the given list of parameters.voidsetBody(AddressSetView set) Set the new body for this function.voidsetCallFixup(String name) Set the named call-fixup for this function.voidsetCallingConvention(String name) Sets the calling convention for this function to the named calling convention.voidsetComment(String comment) Set the comment for this function.voidsetCustomVariableStorage(boolean hasCustomVariableStorage) Set whether or not this function uses custom variable storagevoidsetInline(boolean isInline) Sets whether or not this function is inline.voidsetName(String name, SourceType source) Set the name of this function.voidsetNoReturn(boolean hasNoReturn) Set whether or not this function has a return.voidsetParentNamespace(Namespace newParentScope) Set the parent namespace for this namespace.voidsetRepeatableComment(String comment) Set the repeatable comment for this function.voidsetReturn(DataType type, VariableStorage storage, SourceType source) Set the return data-type and storage.voidsetReturnType(DataType type, SourceType source) Set the function's return type.voidsetSignatureSource(SourceType signatureSource) Set the source type for the overall signature excluding function name and parameter names whose source is carried by the corresponding symbol.voidsetStackPurgeSize(int change) Set the change in the stack pointer resulting from calling this function.voidsetThunkedFunction(Function referencedFunction) Set the currently Thunked Function or null to convert to a normal functionvoidsetValidationEnabled(boolean state) voidsetVarArgs(boolean hasVarArgs) Set whether parameters can be passed as a VarArg (variable argument list)toString()voidupdateFunction(String callingConvention, Variable returnValue, Function.FunctionUpdateType updateType, boolean force, SourceType source, Variable... newParams) Replace all current parameters with the given list of parameters and optionally change the calling convention and function return.voidupdateFunction(String callingConvention, Variable returnVar, List<? extends Variable> newParams, Function.FunctionUpdateType updateType, boolean force, SourceType source) Replace all current parameters with the given list of parameters and optionally change the calling convention and function return.Methods inherited from class ghidra.program.database.DatabaseObject
checkIsValid, checkIsValid, getKey, isDeleted, isInvalid, keyChanged, setDeleted, setInvalid, validateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ghidra.program.model.listing.Function
getFunctionThunkAddresses, hasUnknownCallingConventionNameMethods inherited from interface ghidra.program.model.symbol.Namespace
getPathList, isGlobal, isLibrary
-
Method Details
-
isDeleted
public boolean isDeleted()Description copied from interface:FunctionDetermine if this function object has been deleted. NOTE: the function could be deleted at anytime due to asynchronous activity. -
setValidationEnabled
public void setValidationEnabled(boolean state) -
checkDeleted
protected void checkDeleted()Description copied from class:DatabaseObjectChecks if this object has been deleted, in which case any use of the object is not allowed. This method should be invoked before any modifications to the object are performed to ensure it still exists and is in a valid state.- Overrides:
checkDeletedin classDatabaseObject
-
isThunk
public boolean isThunk() -
getThunkedFunction
Description copied from interface:FunctionIf this function is a Thunk, this method returns the referenced function.- Specified by:
getThunkedFunctionin interfaceFunction- Parameters:
recursive- if true and the thunked-function is a thunk itself, the returned thunked-function will be the final thunked-function which will never be a thunk.- Returns:
- function referenced by this Thunk Function or null if this is not a Thunk function
-
setThunkedFunction
Description copied from interface:FunctionSet the currently Thunked Function or null to convert to a normal function- Specified by:
setThunkedFunctionin interfaceFunction- Parameters:
referencedFunction- the thunked function or null to convert this thunked function to a normal function.
-
getFunctionThunkAddresses
Description copied from interface:FunctionIf this function is "Thunked", an array of Thunk Function entry points is returned.- Specified by:
getFunctionThunkAddressesin interfaceFunction- Parameters:
recursive- if true a recursive search is performed returning all effective thunks of this function, else if false only the first-hop (i.e., direct thunks) are returned.- Returns:
- associated thunk function entry points or null if this is not a "Thunked" function.
-
isExternal
public boolean isExternal()Description copied from interface:NamespaceReturns true if this namespace is external (i.e., associated with a Library)- Specified by:
isExternalin interfaceFunction- Specified by:
isExternalin interfaceNamespace- Returns:
- true if this function is external (i.e., entry point is in EXTERNAL address space)
-
getExternalLocation
- Specified by:
getExternalLocationin interfaceFunction- Returns:
- if this is an external function return the associated external location object.
-
equals
-
hashCode
public int hashCode() -
toString
-
getName
Description copied from interface:FunctionGet the name of this function. -
setName
public void setName(String name, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionSet the name of this function.- Specified by:
setNamein interfaceFunction- Parameters:
name- the new name of the functionsource- the source of this function name- Throws:
DuplicateNameException- if the name is used by some other symbolInvalidInputException- if the name is not a valid function name.
-
getProgram
Description copied from interface:FunctionGet the program containing this function.- Specified by:
getProgramin interfaceFunction- Returns:
- the program
-
getComment
Description copied from interface:FunctionGet the comment for this function.- Specified by:
getCommentin interfaceFunction- Returns:
- the comment for this function
-
getCommentAsArray
Description copied from interface:FunctionReturns the function (same as plate) comment as an array of strings where each item in the array is a line of text in the comment.- Specified by:
getCommentAsArrayin interfaceFunction- Returns:
- the comments
-
setComment
Description copied from interface:FunctionSet the comment for this function.- Specified by:
setCommentin interfaceFunction- Parameters:
comment- the string to set as the comment.
-
getRepeatableComment
Description copied from interface:FunctionReturns the repeatable comment for this function. A repeatable comment is a comment that will appear at locations that 'call' this function.- Specified by:
getRepeatableCommentin interfaceFunction- Returns:
- the repeatable comment for this function
-
getRepeatableCommentAsArray
Description copied from interface:FunctionReturns the repeatable comment as an array of strings.- Specified by:
getRepeatableCommentAsArrayin interfaceFunction- Returns:
- the repeatable comment as an array of strings
-
setRepeatableComment
Description copied from interface:FunctionSet the repeatable comment for this function.- Specified by:
setRepeatableCommentin interfaceFunction- Parameters:
comment- the string to set as the repeatable comment.
-
getEntryPoint
Description copied from interface:FunctionGet the entry point for this function. Functions may only have ONE entry point.- Specified by:
getEntryPointin interfaceFunction- Returns:
- the entry point
-
getBody
Description copied from interface:NamespaceGet the address set for this namespace. Note: The body of a namespace (currently only used by the function namespace) is restricted it Integer.MAX_VALUE. -
setBody
Description copied from interface:FunctionSet the new body for this function. The entry point must be contained in the new body.- Specified by:
setBodyin interfaceFunction- Parameters:
set- address set to use as the body of this function- Throws:
OverlappingFunctionException- if the address set overlaps that of another function
-
getReturnType
Description copied from interface:FunctionGet the Function's return type. A null return value indicates the functions return type has never been set.- Specified by:
getReturnTypein interfaceFunction- Returns:
- the DataType that this function returns.
-
getReturn
Description copied from interface:FunctionGet the Function's return type/storage represented by a Parameter object. The parameter's ordinal value will be equal to Parameter.RETURN_ORIDINAL. -
setReturn
public void setReturn(DataType type, VariableStorage storage, SourceType source) throws InvalidInputException Description copied from interface:FunctionSet the return data-type and storage.NOTE: The storage and source are ignored if the function does not have custom storage enabled.
- Specified by:
setReturnin interfaceFunction- Parameters:
type- the data typestorage- the storagesource- source to be combined with the overall signature source.- Throws:
InvalidInputException- if data type is not a fixed length or storage is improperly sized
-
setReturnType
Description copied from interface:FunctionSet the function's return type.- Specified by:
setReturnTypein interfaceFunction- Parameters:
type- the dataType that will define this functions return type.source- signature source- Throws:
InvalidInputException- if data type is not a fixed length.
-
getSignature
Description copied from interface:FunctionGet the function's signature.
WARNING! It is important to note that the calling convention may not be properly retained by the returned signature object if a non-generic calling convention is used by this function as defined by the program's compiler specification.- Specified by:
getSignaturein interfaceFunction- Parameters:
formalSignature- if true only original raw types will be retained and auto-params discarded (e.g., this, __return_storage_ptr__, etc.) within the returned signature. If false, the effective signature will be returned where forced indirect and auto-params are reflected in the signature. This option has no affect if the specified function has custom storage enabled.- Returns:
- the function's signature
-
getSignature
Description copied from interface:FunctionGet the function's effective signature. This is equivalent to invokinggetSignature(false)where auto-params and forced-indirect types will be reflected in the signature if present.
WARNING! It is important to note that the calling convention may not be properly retained by the returned signature object if a non-generic calling convention is used by this function as defined by the program's compiler specification.- Specified by:
getSignaturein interfaceFunction- Returns:
- the function's signature
-
getPrototypeString
Description copied from interface:FunctionReturn a string representation of the function signature- Specified by:
getPrototypeStringin interfaceFunction- Parameters:
formalSignature- if true only original raw return/parameter types will be retained and auto-params discarded (e.g., this, __return_storage_ptr__, etc.) within the returned signature. If false, the effective signature will be returned where forced indirect and auto-params are reflected in the signature. This option has no affect if the specified function has custom storage enabled.includeCallingConvention- if true prototype will include call convention declaration if known.- Returns:
- the prototype
-
getStackFrame
Description copied from interface:FunctionGet the stack frame for this function. NOTE: Use of the stack frame must be avoided during upgrade activity since the compiler spec may not be known (i.e., due to language upgrade process).- Specified by:
getStackFramein interfaceFunction- Returns:
- this functions stack frame
- See Also:
-
getStackPurgeSize
public int getStackPurgeSize()Description copied from interface:FunctionGet the change in the stack pointer resulting from calling this function.- Specified by:
getStackPurgeSizein interfaceFunction- Returns:
- int the change in bytes to the stack pointer
-
setStackPurgeSize
public void setStackPurgeSize(int change) Description copied from interface:FunctionSet the change in the stack pointer resulting from calling this function.- Specified by:
setStackPurgeSizein interfaceFunction- Parameters:
change- the change in bytes to the stack pointer
-
isStackPurgeSizeValid
public boolean isStackPurgeSizeValid()Description copied from interface:Functioncheck if stack purge size is valid.- Specified by:
isStackPurgeSizeValidin interfaceFunction- Returns:
- true if the stack depth is valid
-
getID
public long getID()Description copied from interface:NamespaceReturn the namespace id -
addLocalVariable
public VariableDB addLocalVariable(Variable var, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionAdds a local variable to the function. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
addLocalVariablein interfaceFunction- Parameters:
var- the variable to add.source- the source of this local variable- Returns:
- the Variable added to the program.
- Throws:
DuplicateNameException- if another local variable or parameter already has that name.InvalidInputException- if there is an error or conflict when resolving the variable- See Also:
-
getVariables
Description copied from interface:FunctionGet all function variables which satisfy the specified filter- Specified by:
getVariablesin interfaceFunction- Parameters:
filter- variable filter or null for all variables to be returned- Returns:
- all function variables which satisfy the specified filter
-
getAllVariables
Description copied from interface:FunctionReturns an array of all local and parameter variables- Specified by:
getAllVariablesin interfaceFunction- Returns:
- the variables
-
getParameters
Description copied from interface:FunctionGet all function parameters which satisfy the specified filter- Specified by:
getParametersin interfaceFunction- Parameters:
filter- variable filter or null for all parameters to be returned- Returns:
- all function parameters which satisfy the specified filter
-
getParameters
Description copied from interface:FunctionGet all function parameters- Specified by:
getParametersin interfaceFunction- Returns:
- all function parameters
-
getLocalVariables
Description copied from interface:FunctionGet all local function variables which satisfy the specified filter- Specified by:
getLocalVariablesin interfaceFunction- Parameters:
filter- variable filter or null for all local variables to be returned- Returns:
- all function variables which satisfy the specified filter
-
getLocalVariables
Description copied from interface:FunctionGet all local function variables- Specified by:
getLocalVariablesin interfaceFunction- Returns:
- all local function variables
-
getParameterCount
public int getParameterCount()Description copied from interface:FunctionGets the total number of parameters for this function. This number also includes any auto-parameters which may have been injected when dynamic parameter storage is used.- Specified by:
getParameterCountin interfaceFunction- Returns:
- the total number of parameters
-
getAutoParameterCount
public int getAutoParameterCount()Description copied from interface:FunctionGets the number of auto-parameters for this function also included in the total count provided byFunction.getParameterCount(). This number will always be 0 when custom parameter storage is used.- Specified by:
getAutoParameterCountin interfaceFunction- Returns:
- the number of auto-parameters
-
replaceParameters
public void replaceParameters(Function.FunctionUpdateType updateType, boolean force, SourceType source, Variable... newParams) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionReplace all current parameters with the given list of parameters. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
replaceParametersin interfaceFunction- Parameters:
updateType- function update typeforce- if true any conflicting local parameters will be removedsource- the source of these parameters which will be applied to the parameter symbols and overall function signature source. If parameter names are null or a default name a SourceType of DEFAULT will be applied to the corresponding parameter symbol.newParams- the new parameters for the function.- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if a parameter data type is not a fixed length or variable name is invalid.
-
replaceParameters
public void replaceParameters(List<? extends Variable> newParams, Function.FunctionUpdateType updateType, boolean force, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionReplace all current parameters with the given list of parameters. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
replaceParametersin interfaceFunction- Parameters:
newParams- the new set of parameters for the function.updateType- function update typeforce- if true any conflicting local parameters will be removedsource- the source of these parameters which will be applied to the parameter symbols and overall function signature source. If parameter names are null or a default name a SourceType of DEFAULT will be applied to the corresponding parameter symbol.- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if a parameter data type is not a fixed length or variable name is invalid.
-
updateFunction
public void updateFunction(String callingConvention, Variable returnValue, Function.FunctionUpdateType updateType, boolean force, SourceType source, Variable... newParams) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionReplace all current parameters with the given list of parameters and optionally change the calling convention and function return. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
updateFunctionin interfaceFunction- Parameters:
callingConvention- updated calling convention name or null if no change is required. Onlyknown calling convention namesmay be specified which will always include those defined by the associatedCompilerSpec.returnValue- return variable or null if no change requiredupdateType- function update typeforce- if true any conflicting local parameters will be removedsource- the source of these parameters which will be applied to the parameter symbols and overall function signature source. If parameter names are null or a default name a SourceType of DEFAULT will be applied to the corresponding parameter symbol.newParams- a variable number of parameters for the function.- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if a parameter data type is not a fixed length or variable name is invalid.
-
updateFunction
public void updateFunction(String callingConvention, Variable returnVar, List<? extends Variable> newParams, Function.FunctionUpdateType updateType, boolean force, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionReplace all current parameters with the given list of parameters and optionally change the calling convention and function return. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
updateFunctionin interfaceFunction- Parameters:
callingConvention- updated calling convention name or null if no change is required. Onlyknown calling convention namesmay be specified which will always include those defined by the associatedCompilerSpec.returnVar- return variable or null if no change requirednewParams- the list of new parameters for the function (required).updateType- function update typeforce- if true any conflicting local parameters will be removedsource- the source of these parameters which will be applied to the parameter symbols and overall function signature source. If parameter names are null or a default name a SourceType of DEFAULT will be applied to the corresponding parameter symbol.- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if a parameter data type is not a fixed length or variable name is invalid.
-
addParameter
public Parameter addParameter(Variable var, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionAdds the given variable to the end of the parameters list. The variable storage specified for the new parameter will be ignored if custom storage mode is not enabled. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
addParameterin interfaceFunction- Parameters:
var- the variable to add as a new parameter.source- the source of this parameter which will be applied to the parameter symbol and overall function signature source. If parameter has a null or default name a SourceType of DEFAULT will be applied to the parameter symbol.- Returns:
- the Parameter object created.
- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if data type is not a fixed length or variable name is invalid.
-
insertParameter
public ghidra.program.database.function.ParameterDB insertParameter(int ordinal, Variable var, SourceType source) throws DuplicateNameException, InvalidInputException Description copied from interface:FunctionInserts the given variable into the parameters list. The variable storage specified for the new parameter will be ignored if custom storage mode is not enabled. TheVariableUtilities.checkVariableConflict(Function, Variable, VariableStorage, boolean)method may be used to check and remove conflicting variables which already exist in the function.- Specified by:
insertParameterin interfaceFunction- Parameters:
ordinal- the position with the parameters to insert to. This ordinal must factor in the presence of auto-parameters which may be injected dynamically based upon calling convention and return data type. Parameters may not be inserted befor an auto-parameter.var- the variable to add as a new parameter.source- the source of this parameter which will be applied to the parameter symbol and overall function signature source. If parameter has a null or default name a SourceType of DEFAULT will be applied to the parameter symbol.- Returns:
- the Parameter object created.
- Throws:
DuplicateNameException- if another variable(parameter or local) already exists in the function with that name.InvalidInputException- if data type is not a fixed length or variable name is invalid.- See Also:
-
removeVariable
Description copied from interface:FunctionRemoves the given variable from the function.- Specified by:
removeVariablein interfaceFunction- Parameters:
variable- the variable to remove.
-
removeParameter
public void removeParameter(int ordinal) Description copied from interface:FunctionRemove the specified parameter. Auto-parameters may not be removed but must be accounted for in the specified ordinal.- Specified by:
removeParameterin interfaceFunction- Parameters:
ordinal- the index of the parameter to be removed.
-
refresh
protected boolean refresh()Description copied from class:DatabaseObjectTells the object to refresh its state from the database.- Specified by:
refreshin classDatabaseObject- Returns:
- true if the object was able to refresh itself. Return false if the object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
-
refresh
Description copied from class:DatabaseObjectTells the object to refresh its state from the database using the specified record if not null. NOTE: The default implementation ignores the record and invokes refresh(). Implementations of this method must take care if multiple database tables are used since the record supplied could correspond to another object. In some cases it may be best not to override this method or ignore the record provided.- Overrides:
refreshin classDatabaseObject- Parameters:
refreshRec- valid record associated with object's key (optional, may be null to force record lookup or other refresh technique)- Returns:
- true if the object was able to refresh itself. Return false if record is null and object was deleted. Objects that extend this class must implement a refresh method. If an object can never refresh itself, then it should always return false.
-
doDeleteVariable
Callback to remove variable just prior to removal of the underlying symbol.- Parameters:
symbol- variable symbol which is about to be deleted.
-
getVariable
Return the Variable for the given symbol.- Parameters:
symbol- variable symbol- Returns:
- Variable which corresponds to specified symbol
-
getParameter
Description copied from interface:FunctionReturns the specified parameter including an auto-param at the specified ordinal.- Specified by:
getParameterin interfaceFunction- Parameters:
ordinal- the index of the parameter to return.- Returns:
- parameter or null if ordinal is out of range
-
moveParameter
Description copied from interface:FunctionMove the parameter which occupies the fromOrdinal position to the toOrdinal position. Parameters will be renumbered to reflect the new ordering. Auto-parameters may not be moved but must be accounted for in the specified ordinals.- Specified by:
moveParameterin interfaceFunction- Parameters:
fromOrdinal- from ordinal position using the current numberingtoOrdinal- the final position of the specified parameter- Returns:
- parameter which was moved
- Throws:
InvalidInputException- if either ordinal is invalid
-
getSymbol
Description copied from interface:NamespaceGet the symbol for this namespace. -
setParentNamespace
public void setParentNamespace(Namespace newParentScope) throws DuplicateNameException, InvalidInputException, CircularDependencyException Description copied from interface:NamespaceSet the parent namespace for this namespace. Restrictions may apply.- Specified by:
setParentNamespacein interfaceNamespace- Parameters:
newParentScope- the namespace to use as this namespace's parent.- Throws:
DuplicateNameException- if another symbol exists in the parent namespace with the same name as this namespaceInvalidInputException- if the parent namespace is not applicable for this namespace.CircularDependencyException- if the parent namespace is a descendant of this namespace.
-
getParentNamespace
Description copied from interface:NamespaceGet the parent scope.- Specified by:
getParentNamespacein interfaceNamespace- Returns:
- null if this scope is the global scope.
- See Also:
-
getName
Description copied from interface:NamespaceReturns the fully qualified name -
hasVarArgs
public boolean hasVarArgs()Description copied from interface:FunctionReturns true if this function has a variable argument list (VarArgs)- Specified by:
hasVarArgsin interfaceFunction- Returns:
- true if this function has a variable argument list (VarArgs)
-
setVarArgs
public void setVarArgs(boolean hasVarArgs) Description copied from interface:FunctionSet whether parameters can be passed as a VarArg (variable argument list)- Specified by:
setVarArgsin interfaceFunction- Parameters:
hasVarArgs- true if this function has a variable argument list (e.g., printf(fmt, ...)).
-
isInline
public boolean isInline() -
setInline
public void setInline(boolean isInline) Description copied from interface:FunctionSets whether or not this function is inline. -
hasNoReturn
public boolean hasNoReturn()- Specified by:
hasNoReturnin interfaceFunction- Returns:
- true if this function does not return.
-
setNoReturn
public void setNoReturn(boolean hasNoReturn) Description copied from interface:FunctionSet whether or not this function has a return.- Specified by:
setNoReturnin interfaceFunction- Parameters:
hasNoReturn- true if this function does not return.
-
hasCustomVariableStorage
public boolean hasCustomVariableStorage()- Specified by:
hasCustomVariableStoragein interfaceFunction- Returns:
- true if function parameters utilize custom variable storage.
-
setCustomVariableStorage
public void setCustomVariableStorage(boolean hasCustomVariableStorage) Description copied from interface:FunctionSet whether or not this function uses custom variable storage- Specified by:
setCustomVariableStoragein interfaceFunction- Parameters:
hasCustomVariableStorage- true if this function uses custom storage
-
getSignatureSource
Description copied from interface:FunctionReturns the source type for the overall signature excluding function name and parameter names whose source is carried by the corresponding symbol.- Specified by:
getSignatureSourcein interfaceFunction- Returns:
- the overall SourceType of the function signature;
-
setSignatureSource
Description copied from interface:FunctionSet the source type for the overall signature excluding function name and parameter names whose source is carried by the corresponding symbol.- Specified by:
setSignatureSourcein interfaceFunction- Parameters:
signatureSource- function signature source type
-
getCallingConvention
Description copied from interface:FunctionGets the calling convention prototype model for this function.- Specified by:
getCallingConventionin interfaceFunction- Returns:
- the prototype model of the function's current calling convention or null.
-
getCallingConventionName
Description copied from interface:FunctionGets the calling convention's name for this function.- Specified by:
getCallingConventionNamein interfaceFunction- Returns:
- the name of the calling convention or Function.DEFAULT_CALLING_CONVENTION_STRING (i.e. "default", if the calling convention has been set to the default for this function) or Function.UNKNOWN_CALLING_CONVENTION_STRING (i.e. "unknown", if no calling convention is specified for this function).
-
setCallingConvention
Description copied from interface:FunctionSets the calling convention for this function to the named calling convention. Onlyknown calling convention namesmay be specified which will always include those defined by the associatedCompilerSpec.- Specified by:
setCallingConventionin interfaceFunction- Parameters:
name- the name of the calling convention. Onlyknown calling convention namesmay be specified which will always include those defined by the associatedCompilerSpec. In addition the reserved names"unknown"and"default"may also be used here.- Throws:
InvalidInputException- if the specified name is not a recognized calling convention name.
-
getCallFixup
Description copied from interface:FunctionReturns the current call-fixup name set on this instruction or null if one has not been set- Specified by:
getCallFixupin interfaceFunction- Returns:
- the call fixup name or null
-
setCallFixup
Description copied from interface:FunctionSet the named call-fixup for this function.- Specified by:
setCallFixupin interfaceFunction- Parameters:
name- name of call-fixup specified by compiler spec. A null value will clear the current setting.
-
getCallingFunctions
Description copied from interface:FunctionReturns a set of functions that call this function.- Specified by:
getCallingFunctionsin interfaceFunction- Parameters:
monitor- The monitor that is used to report progress and allow for canceling of the search. May be null.- Returns:
- a set of functions that call this function.
-
getCalledFunctions
Description copied from interface:FunctionReturns a set of functions that this function calls.- Specified by:
getCalledFunctionsin interfaceFunction- Parameters:
monitor- The monitor that is used to report progress and allow for canceling of the search. May be null.- Returns:
- a set of functions that this function calls.
-
getTags
Description copied from interface:FunctionReturn allFunctionTagobjects associated with this function. -
addTag
Description copied from interface:FunctionAdds the tag with the given name to this function; if one does not exist, one is created. -
removeTag
Description copied from interface:FunctionRemoves the given tag from this function. -
promoteLocalUserLabelsToGlobal
public void promoteLocalUserLabelsToGlobal()Description copied from interface:FunctionChanges all local user-defined labels for this function to global symbols. If a global code symbol already exists with the same name at the symbols address the symbol will be removed.- Specified by:
promoteLocalUserLabelsToGlobalin interfaceFunction
-