Ghidra 11.3.2
Ghidra internal decompiler documentation.
|
Consume multiple registers from different storage classes to pass a data-type. More...
#include <modelrules.hh>
Public Member Functions | |
MultiSlotDualAssign (const ParamListStandard *res) | |
Constructor for use with decode. | |
MultiSlotDualAssign (type_class baseStore, type_class altStore, bool mostSig, bool justRight, const ParamListStandard *res) | |
Constructor. | |
virtual AssignAction * | clone (const ParamListStandard *newResource) const |
Make a copy of this action. | |
virtual uint4 | assignAddress (Datatype *dt, const PrototypePieces &proto, int4 pos, TypeFactory &tlist, vector< int4 > &status, ParameterPieces &res) const |
Assign an address and other meta-data for a specific parameter or for return storage in context. | |
virtual bool | fillinOutputMap (ParamActive *active) const |
Test if this action could produce return value storage matching the given set of trials. | |
virtual void | decode (Decoder &decoder) |
Configure any details of how this action should behave from the stream. | |
![]() | |
AssignAction (const ParamListStandard *res) | |
Constructor. | |
bool | canAffectFillinOutput (void) const |
Return true if fillinOutputMap is active. | |
Private Member Functions | |
void | initializeEntries (void) |
Cache specific ParamEntry needed by the action. | |
list< ParamEntry >::const_iterator | getFirstUnused (list< ParamEntry >::const_iterator iter, type_class storage, vector< int4 > &status) const |
Get the first unused ParamEntry that matches the given storage class. | |
int4 | getTileClass (const PrimitiveExtractor &primitives, int4 off, int4 &index) const |
Get the storage class to use for the specific section of the data-type. | |
Private Attributes | |
type_class | baseType |
Resource list from which to consume general tiles. | |
type_class | altType |
Resource list from which to consume alternate tiles. | |
bool | consumeMostSig |
True if resources are consumed starting with most significant bytes. | |
bool | justifyRight |
True if initial bytes are padding for odd data-type sizes. | |
int4 | tileSize |
Number of bytes in a tile. | |
list< ParamEntry >::const_iterator | baseIter |
Iterator to first element in the base resource list. | |
list< ParamEntry >::const_iterator | altIter |
Iterator to first element in alternate resource list. | |
Additional Inherited Members | |
![]() | |
enum | { success , fail , no_assignment , hiddenret_ptrparam , hiddenret_specialreg , hiddenret_specialreg_void } |
![]() | |
static AssignAction * | decodeAction (Decoder &decoder, const ParamListStandard *res) |
Read the next model rule action element from the stream. | |
static AssignAction * | decodeSideeffect (Decoder &decoder, const ParamListStandard *res) |
Read the next model rule sideeffect element from the stream. | |
![]() | |
const ParamListStandard * | resource |
Resources to which this action applies. | |
bool | fillinOutputActive |
If true, fillinOutputMap is active. | |
Consume multiple registers from different storage classes to pass a data-type.
This action is for calling conventions that can use both floating-point and general purpose registers when assigning storage for a single composite data-type, such as the X86-64 System V ABI
ghidra::MultiSlotDualAssign::MultiSlotDualAssign | ( | const ParamListStandard * | res | ) |
Constructor for use with decode.
Set default configuration
res | is the new resource set to associate with this action |
References altType, baseType, consumeMostSig, ghidra::AssignAction::fillinOutputActive, ghidra::ParamListStandard::getSpacebase(), ghidra::AddrSpace::isBigEndian(), justifyRight, tileSize, ghidra::TYPECLASS_FLOAT, and ghidra::TYPECLASS_GENERAL.
|
virtual |
Assign an address and other meta-data for a specific parameter or for return storage in context.
The Address is assigned based on the data-type of the parameter, available register resources, and other details of the function prototype. Consumed resources are marked. This method returns a response code:
dt | is the data-type of the parameter or return value |
proto | is the high-level description of the function prototype |
pos | is the position of the parameter (pos>=0) or return storage (pos=-1) |
tlist | is a data-type factory for (possibly) transforming the data-type |
status | is the resource consumption array |
res | will hold the resulting description of the parameter |
Implements ghidra::AssignAction.
References ghidra::ParameterPieces::addr, altIter, altType, baseIter, baseType, consumeMostSig, ghidra::PrimitiveExtractor::containsHoles(), ghidra::AssignAction::fail, ghidra::AddrSpaceManager::findAddJoin(), ghidra::ParameterPieces::flags, ghidra::VarnodeData::getAddr(), ghidra::ParamEntry::getAddrBySlot(), ghidra::TypeFactory::getArch(), ghidra::ParamListStandard::getEntry(), getFirstUnused(), ghidra::ParamEntry::getGroup(), ghidra::Address::getOffset(), ghidra::ParamEntry::getSize(), ghidra::Datatype::getSize(), ghidra::Address::getSpace(), getTileClass(), ghidra::JoinRecord::getUnified(), ghidra::PrimitiveExtractor::isValid(), justifyRight, ghidra::AssignAction::resource, ghidra::PrimitiveExtractor::size(), ghidra::AssignAction::success, and ghidra::ParameterPieces::type.
|
inlinevirtual |
Make a copy of this action.
newResource | is the new resource object that will own the clone |
Implements ghidra::AssignAction.
References altType, baseType, consumeMostSig, and justifyRight.
|
virtual |
Configure any details of how this action should behave from the stream.
decoder | is the given stream decoder |
Implements ghidra::AssignAction.
References altType, baseType, ghidra::Decoder::closeElement(), ghidra::Decoder::getNextAttributeId(), initializeEntries(), justifyRight, ghidra::Decoder::openElement(), ghidra::Decoder::readBool(), and ghidra::Decoder::readString().
|
virtual |
Test if this action could produce return value storage matching the given set of trials.
If there is a return value data-type that could be assigned storage matching the trials by this action, return true. The trials have their matching ParamEntry and offset already set and are already sorted.
active | is the given set of trials |
Reimplemented from ghidra::AssignAction.
References altType, baseType, consumeMostSig, ghidra::ParamTrial::getEntry(), ghidra::ParamEntry::getGroup(), ghidra::ParamActive::getNumTrials(), ghidra::ParamTrial::getOffset(), ghidra::ParamEntry::getSize(), ghidra::ParamTrial::getSize(), ghidra::ParamActive::getTrial(), ghidra::ParamEntry::getType(), ghidra::ParamEntry::isFirstInClass(), justifyRight, and ghidra::TYPECLASS_GENERAL.
|
private |
Get the first unused ParamEntry that matches the given storage class.
iter | points to the starting entry to search |
storage | is the given storage class to match |
status | is the usage information for the entries |
References ghidra::ParamEntry::getAllGroups(), ghidra::ParamListStandard::getEntry(), ghidra::ParamEntry::getGroup(), ghidra::ParamEntry::getType(), ghidra::ParamEntry::isExclusion(), and ghidra::AssignAction::resource.
Referenced by assignAddress().
|
private |
Get the storage class to use for the specific section of the data-type.
For the section starting at off extending through tileSize bytes, if any primitive overlaps the boundary of the section, return -1. Otherwise, if all the primitive data-types in the section match the alternate storage class, return 1, or if one or more does not match, return 0. The index of the first primitive after the start of the section is provided and is then updated to be the first primitive after the end of the section.
primitives | is the list of primitive data-types making up the data-type |
off | is the starting offset of the section |
index | is the index of the first primitive in the section |
References altType, ghidra::PrimitiveExtractor::Primitive::dt, ghidra::PrimitiveExtractor::get(), ghidra::Datatype::getMetatype(), ghidra::Datatype::getSize(), ghidra::PrimitiveExtractor::Primitive::offset, ghidra::PrimitiveExtractor::size(), and tileSize.
Referenced by assignAddress().
|
private |
Cache specific ParamEntry needed by the action.
Find the first ParamEntry matching the baseType, and the first matching altType.
References altIter, altType, baseIter, baseType, ghidra::ParamListStandard::getEntry(), ghidra::ParamListStandard::getFirstIter(), ghidra::AssignAction::resource, and tileSize.
Referenced by decode(), and MultiSlotDualAssign().