|
Ghidra 11.4.2
Ghidra internal decompiler documentation.
|
A collection of parameter descriptions without backing symbols. More...
#include <fspec.hh>
Public Member Functions | |
| ProtoStoreInternal (Datatype *vt) | |
| Constructor. | |
| virtual ProtoParameter * | setInput (int4 i, const string &nm, const ParameterPieces &pieces) |
| Establish name, data-type, storage of a specific input parameter. | |
| virtual void | clearInput (int4 i) |
| Clear the input parameter at the specified slot. | |
| 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. | |
| 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 | encode (Encoder &encoder) const |
| Encode any parameters that are not backed by symbols to a stream. | |
| virtual void | decode (Decoder &decoder, ProtoModel *model) |
| Restore any internal parameter descriptions from a stream. | |
Public Member Functions inherited from ghidra::ProtoStore | |
| virtual | ~ProtoStore (void) |
| Constructor. | |
Private Attributes | |
| Datatype * | voidtype |
| Cached reference to the void data-type. | |
| vector< ProtoParameter * > | inparam |
| Descriptions of input parameters. | |
| ProtoParameter * | outparam |
| Description of the return value. | |
A collection of parameter descriptions without backing symbols.
Parameter descriptions are stored internally to the object and are not mirrored by a symbol table.
| ghidra::ProtoStoreInternal::ProtoStoreInternal | ( | Datatype * | vt | ) |
| vt | is the void data-type used for an unspecified return value |
References ghidra::ParameterPieces::flags, outparam, setOutput(), ghidra::ParameterPieces::type, and voidtype.
|
virtual |
Clear all input parameters (and any backing symbols)
Implements ghidra::ProtoStore.
References inparam.
|
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 ghidra::ProtoStore.
References inparam.
|
virtual |
Clear the return value to TYPE_VOID.
Implements ghidra::ProtoStore.
|
virtual |
Clone the entire collection of parameter descriptions.
Implements ghidra::ProtoStore.
References ghidra::ProtoParameter::clone(), inparam, outparam, and voidtype.
|
virtual |
Restore any internal parameter descriptions from a stream.
Parse an <internallist> element containing <param> and <retparam> child elements.
| decoder | is the stream decoder |
| model | is prototype model for determining storage for unassigned parameters |
Implements ghidra::ProtoStore.
References ghidra::ParameterPieces::addr, ghidra::ProtoModel::assignParameterStorage(), ghidra::Decoder::closeElement(), ghidra::Address::decode(), ghidra::TypeFactory::decodeType(), ghidra::PrototypePieces::firstVarArgSlot, ghidra::ParameterPieces::flags, ghidra::Datatype::flags, ghidra::ProtoParameter::getAddress(), ghidra::ProtoModel::getArch(), ghidra::Decoder::getNextAttributeId(), ghidra::ProtoParameter::getType(), ghidra::ParameterPieces::hiddenretparm, ghidra::ParameterPieces::indirectstorage, ghidra::PrototypePieces::innames, ghidra::PrototypePieces::intypes, ghidra::ProtoParameter::isIndirectStorage(), ghidra::Address::isInvalid(), ghidra::ParameterPieces::isthis, ghidra::ProtoParameter::isTypeLocked(), ghidra::PrototypePieces::model, ghidra::ParameterPieces::namelock, ghidra::Decoder::openElement(), outparam, ghidra::PrototypePieces::outtype, ghidra::Decoder::readBool(), ghidra::Decoder::readSignedInteger(), ghidra::Decoder::readString(), setInput(), ghidra::ProtoParameter::setNameLock(), setOutput(), ghidra::ProtoParameter::setTypeLock(), ghidra::ParameterPieces::type, ghidra::ParameterPieces::typelock, and ghidra::Architecture::types.
|
virtual |
Encode any parameters that are not backed by symbols to a stream.
Symbols are stored elsewhere, so symbol backed parameters are not serialized. If there are any internal parameters an <internallist> element is emitted.
| encoder | is the stream encoder |
Implements ghidra::ProtoStore.
References ghidra::Encoder::closeElement(), ghidra::Address::encode(), ghidra::Datatype::encodeRef(), ghidra::ProtoParameter::getAddress(), ghidra::ProtoParameter::getName(), ghidra::ProtoParameter::getType(), inparam, ghidra::ProtoParameter::isHiddenReturn(), ghidra::ProtoParameter::isIndirectStorage(), ghidra::ProtoParameter::isNameLocked(), ghidra::ProtoParameter::isThisPointer(), ghidra::ProtoParameter::isTypeLocked(), ghidra::Encoder::openElement(), outparam, ghidra::Encoder::writeBool(), and ghidra::Encoder::writeString().
|
virtual |
Get the i-th input parameter (or NULL if it doesn't exist)
Implements ghidra::ProtoStore.
References inparam.
|
virtual |
Get the number of input parameters for this prototype.
Implements ghidra::ProtoStore.
References inparam.
|
virtual |
|
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 ghidra::ProtoStore.
References ghidra::ParameterPieces::addr, ghidra::ParameterPieces::flags, inparam, and ghidra::ParameterPieces::type.
Referenced by decode().
|
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 ghidra::ProtoStore.
References ghidra::ParameterPieces::addr, ghidra::ParameterPieces::flags, outparam, and ghidra::ParameterPieces::type.
Referenced by decode(), and ProtoStoreInternal().