Package ghidra.program.model.pcode
Class FunctionPrototype
java.lang.Object
ghidra.program.model.pcode.FunctionPrototype
High-level prototype of a function based on Varnodes, describing the inputs and outputs
 of this function.
- 
Constructor SummaryConstructorsConstructorDescriptionFunctionPrototype(FunctionSignature proto, CompilerSpec cspec, boolean voidimpliesdotdotdot) Construct an internally backed prototype based on a FunctionSignature prototypeFunctionPrototype(LocalSymbolMap ls, Function func) Construct a FunctionPrototype backed by a local symbolmap.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddecodePrototype(Decoder decoder, PcodeFactory pcodeFactory) Decode the function prototype from a<prototype>element in the stream.voidencodePrototype(Encoder encoder, PcodeDataTypeManager dtmanage, int firstVarArg) Encode this function prototype to a stream.intintgetParam(int i) booleanbooleanbooleanbooleanbooleanbooleanisInline()booleanisVarArg()
- 
Constructor Details- 
FunctionPrototypeConstruct a FunctionPrototype backed by a local symbolmap. This is only a partial initialization. It is intended to be followed either by grabFromFunction() or readPrototypeXML()- Parameters:
- ls- is the LocalSymbolMap backing the prototype
- func- is the function using the symbolmap
 
- 
FunctionPrototypeConstruct an internally backed prototype based on a FunctionSignature prototype- Parameters:
- proto- is the FunctionSignature used to internally back input parameters
- cspec- is the compiler spec used to pick prototype model
- voidimpliesdotdotdot- set to true if a void prototype is interpreted as varargs
 
 
- 
- 
Method Details- 
getNumParamspublic int getNumParams()- Returns:
- the number of defined parameters for this function prototype
 
- 
getParam- Parameters:
- i- i'th parameter index
- Returns:
- the i'th HighParam to this function prototype or null if this prototype is not backed by a LocalSymbolMap
 
- 
getParameterDefinitions- Returns:
- parameter definitions if prototype was produced from a FunctionSignature or null if backed by a LocalSymbolMap
 
- 
isBackedByLocalSymbolMappublic boolean isBackedByLocalSymbolMap()- Returns:
- true if this prototype is backed by a LocalSymbolMap, or false if generated from a FunctionSignature.
 
- 
getReturnType- Returns:
- the return type for the function
 
- 
getReturnStorage- Returns:
- the return storage for the function
 
- 
getExtraPoppublic int getExtraPop()- Returns:
- the number of extra bytes popped off by this functions return
 
- 
isVarArgpublic boolean isVarArg()- Returns:
- true if this function has variable arguments
 
- 
isInlinepublic boolean isInline()- Returns:
- true if this function should be inlined by the decompile
 
- 
hasNoReturnpublic boolean hasNoReturn()- Returns:
- true if calls to this function do not return
 
- 
hasThisPointerpublic boolean hasThisPointer()- Returns:
- true if this function is a method taking a 'this' pointer as a parameter
 
- 
isConstructorpublic boolean isConstructor()- Returns:
- true if this function is an (object-oriented) constructor
 
- 
isDestructorpublic boolean isDestructor()- Returns:
- true if this function is an (object-oriented) destructor
 
- 
getModelName- Returns:
- calling convention model name specific to the associated compiler spec
 
- 
encodePrototypepublic void encodePrototype(Encoder encoder, PcodeDataTypeManager dtmanage, int firstVarArg) throws IOException Encode this function prototype to a stream.- Parameters:
- encoder- is the stream encoder
- dtmanage- is the DataTypeManager for building type reference tags
- firstVarArg- is index of first variable argument or -1
- Throws:
- IOException- for errors in the underlying stream
 
- 
decodePrototypeDecode the function prototype from a<prototype>element in the stream.- Parameters:
- decoder- is the stream decoder
- pcodeFactory- is used to resolve data-type and address space references
- Throws:
- DecoderException- for invalid encodings
 
 
-