decompiler
1.0.0
|
A collection of parameter descriptions backed by Symbol information. More...
#include <fspec.hh>
Public Member Functions | |
ProtoStoreSymbol (Scope *sc, const Address &usepoint) | |
Constructor. More... | |
virtual ProtoParameter * | setInput (int4 i, const string &nm, const ParameterPieces &pieces) |
Establish name, data-type, storage of a specific input parameter. More... | |
virtual void | clearInput (int4 i) |
Clear the input parameter at the specified slot. More... | |
virtual void | clearAllInputs (void) |
Clear all input parameters (and any backing symbols) | |
virtual int4 | getNumInputs (void) const |
Get the number of input parameters for this prototype. | |
virtual ProtoParameter * | getInput (int4 i) |
Get the i-th input parameter (or NULL if it doesn't exist) | |
virtual ProtoParameter * | setOutput (const ParameterPieces &piece) |
Establish the data-type and storage of the return value. More... | |
virtual void | clearOutput (void) |
Clear the return value to TYPE_VOID. | |
virtual ProtoParameter * | getOutput (void) |
Get the return-value description. | |
virtual ProtoStore * | clone (void) const |
Clone the entire collection of parameter descriptions. | |
virtual void | saveXml (ostream &s) const |
Save any parameters that are not backed by symbols to an XML stream. More... | |
virtual void | restoreXml (const Element *el, ProtoModel *model) |
Restore any internal parameter descriptions from an XML stream. More... | |
Public Member Functions inherited from ProtoStore | |
virtual | ~ProtoStore (void) |
Constructor. | |
Private Member Functions | |
ParameterSymbol * | getSymbolBacked (int4 i) |
Fetch or allocate the parameter for the indicated slot. More... | |
Private Attributes | |
Scope * | scope |
Backing Scope for input parameters. | |
Address | restricted_usepoint |
A usepoint reference for storage locations (usually function entry -1) | |
vector< ProtoParameter * > | inparam |
Cache of allocated input parameters. | |
ProtoParameter * | outparam |
The return-value parameter. | |
A collection of parameter descriptions backed by Symbol information.
Input parameters are determined by symbols a function Scope (category 0). Information about the return-value is stored internally. ProtoParameter objects are constructed on the fly as requested and cached.
Constructor.
sc | is the function Scope that will back this store |
usepoint | is the starting address of the function (-1) |
References ParameterPieces::flags, setOutput(), and ParameterPieces::type.
|
virtual |
Clear the input parameter at the specified slot.
The parameter is excised, any following parameters are shifted to fill its spot. If there is a backing Symbol, it is removed from the SymbolTable
i | is the specified parameter slot to remove |
Implements ProtoStore.
|
private |
Fetch or allocate the parameter for the indicated slot.
Retrieve the specified ProtoParameter object, making sure it is a ParameterSymbol. If it doesn't exist, or if the object in the specific slot is not a ParameterSymbol, allocate an (unitialized) parameter.
i | is the specified input slot |
|
virtual |
Restore any internal parameter descriptions from an XML stream.
el | is a root <internallist> element containing <param> and <retparam> sub-tags. |
model | is prototype model for determining storage for unassigned parameters |
Implements ProtoStore.
|
virtual |
Save any parameters that are not backed by symbols to an XML stream.
Symbols are stored elsewhere, so symbol backed parameters are not serialized. If there are any internal parameters an <internallist> tag is emitted.
s | is the output stream |
Implements ProtoStore.
|
virtual |
Establish name, data-type, storage of a specific input parameter.
This either allocates a new parameter or replaces the existing one at the specified input slot. If there is a backing symbol table, a Symbol is created or modified.
i | is the specified input slot |
nm | is the (optional) name of the parameter |
pieces | holds the raw storage address and data-type to set |
Implements ProtoStore.
References ParameterPieces::addr, ParameterPieces::flags, SymbolEntry::getAddr(), Symbol::getFirstWholeMap(), Symbol::getName(), Datatype::getSize(), SymbolEntry::getSize(), Symbol::getType(), Varnode::hiddenretparm, ParameterPieces::hiddenretparm, Varnode::indirectstorage, ParameterPieces::indirectstorage, Symbol::isHiddenReturn(), Symbol::isIndirectStorage(), ParameterSymbol::sym, and ParameterPieces::type.
|
virtual |
Establish the data-type and storage of the return value.
This either allocates a new parameter or replaces the existing one. A void return value can be specified with an invalid address and TYPE_VOID data-type.
piece | holds the raw storage address and data-type to set |
Implements ProtoStore.
References ParameterPieces::addr, ParameterPieces::flags, and ParameterPieces::type.
Referenced by ProtoStoreSymbol().