decompiler 1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ghidra::MultiSlotAssign Class Reference

Consume multiple registers to pass a data-type. More...

#include <modelrules.hh>

Inheritance diagram for ghidra::MultiSlotAssign:
ghidra::AssignAction

Public Member Functions

 MultiSlotAssign (const ParamListStandard *res)
 Constructor for use with decode. More...
 
 MultiSlotAssign (type_class store, bool stack, bool mostSig, bool align, bool justRight, const ParamListStandard *res)
 Constructor.
 
virtual AssignActionclone (const ParamListStandard *newResource) const
 Make a copy of this action. More...
 
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. More...
 
virtual void decode (Decoder &decoder)
 Configure any details of how this action should behave from the stream. More...
 
- Public Member Functions inherited from ghidra::AssignAction
 AssignAction (const ParamListStandard *res)
 Constructor.
 
virtual AssignActionclone (const ParamListStandard *newResource) const =0
 Make a copy of this action. More...
 
virtual uint4 assignAddress (Datatype *dt, const PrototypePieces &proto, int4 pos, TypeFactory &tlist, vector< int4 > &status, ParameterPieces &res) const =0
 Assign an address and other meta-data for a specific parameter or for return storage in context. More...
 
virtual void decode (Decoder &decoder)=0
 Configure any details of how this action should behave from the stream. More...
 

Private Member Functions

void initializeEntries (void)
 Cache specific ParamEntry needed by the action. More...
 

Private Attributes

type_class resourceType
 Resource list from which to consume.
 
bool consumeFromStack
 True if resources should be consumed from the stack.
 
bool consumeMostSig
 True if resources are consumed starting with most significant bytes.
 
bool enforceAlignment
 True if register resources are discarded to match alignment.
 
bool justifyRight
 True if initial bytes are padding for odd data-type sizes.
 
const ParamEntrystackEntry
 The stack resource.
 
list< ParamEntry >::const_iterator firstIter
 Iterator to first element in the resource list.
 

Additional Inherited Members

- Public Types inherited from ghidra::AssignAction
enum  {
  success , fail , no_assignment , hiddenret_ptrparam ,
  hiddenret_specialreg , hiddenret_specialreg_void
}
 
- Static Public Member Functions inherited from ghidra::AssignAction
static AssignActiondecodeAction (Decoder &decoder, const ParamListStandard *res)
 Read the next model rule action element from the stream. More...
 
static AssignActiondecodeSideeffect (Decoder &decoder, const ParamListStandard *res)
 Read the next model rule sideeffect element from the stream. More...
 
- Protected Attributes inherited from ghidra::AssignAction
const ParamListStandardresource
 Resources to which this action applies.
 

Detailed Description

Consume multiple registers to pass a data-type.

Available registers are consumed until the data-type is covered, and an appropriate join space address is assigned. Registers can be consumed from a specific resource list. Consumption can spill over onto the stack if desired.

Constructor & Destructor Documentation

◆ MultiSlotAssign()

ghidra::MultiSlotAssign::MultiSlotAssign ( const ParamListStandard res)

Member Function Documentation

◆ assignAddress()

uint4 ghidra::MultiSlotAssign::assignAddress ( Datatype dt,
const PrototypePieces proto,
int4  pos,
TypeFactory tlist,
vector< int4 > &  status,
ParameterPieces res 
) const
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:

  • success - indicating the Address was successfully assigned
  • fail - if the Address could not be assigned
  • hiddenret_ptrparam - if an additional hidden return parameter is required
Parameters
dtis the data-type of the parameter or return value
protois the high-level description of the function prototype
posis the position of the parameter (pos>=0) or return storage (pos=-1)
tlistis a data-type factory for (possibly) transforming the data-type
statusis the resource consumption array
reswill hold the resulting description of the parameter
Returns
the response code

Implements ghidra::AssignAction.

References ghidra::ParameterPieces::addr, ghidra::AddrSpaceManager::constructFloatExtensionAddress(), consumeFromStack, consumeMostSig, enforceAlignment, ghidra::AssignAction::fail, ghidra::AddrSpaceManager::findAddJoin(), firstIter, ghidra::ParameterPieces::flags, ghidra::VarnodeData::getAddr(), ghidra::ParamEntry::getAddrBySlot(), ghidra::Datatype::getAlignment(), ghidra::ParamEntry::getAllGroups(), ghidra::TypeFactory::getArch(), ghidra::ParamListStandard::getEntry(), ghidra::ParamEntry::getGroup(), ghidra::Address::getOffset(), ghidra::ParamEntry::getSize(), ghidra::Datatype::getSize(), ghidra::Address::getSpace(), ghidra::ParamEntry::getType(), ghidra::JoinRecord::getUnified(), ghidra::ParamEntry::isExclusion(), ghidra::Address::isInvalid(), justifyRight, ghidra::VarnodeData::offset, ghidra::AssignAction::resource, resourceType, ghidra::VarnodeData::size, ghidra::VarnodeData::space, stackEntry, ghidra::AssignAction::success, ghidra::ParameterPieces::type, and ghidra::TYPECLASS_FLOAT.

◆ clone()

virtual AssignAction * ghidra::MultiSlotAssign::clone ( const ParamListStandard newResource) const
inlinevirtual

Make a copy of this action.

Parameters
newResourceis the new resource object that will own the clone
Returns
the newly allocated copy

Implements ghidra::AssignAction.

References consumeFromStack, consumeMostSig, enforceAlignment, justifyRight, MultiSlotAssign(), and resourceType.

◆ decode()

void ghidra::MultiSlotAssign::decode ( Decoder decoder)
virtual

Configure any details of how this action should behave from the stream.

Parameters
decoderis the given stream decoder

Implements ghidra::AssignAction.

References ghidra::Decoder::closeElement(), enforceAlignment, ghidra::Decoder::getNextAttributeId(), initializeEntries(), justifyRight, ghidra::Decoder::openElement(), ghidra::Decoder::readBool(), ghidra::Decoder::readString(), and resourceType.

◆ initializeEntries()

void ghidra::MultiSlotAssign::initializeEntries ( void  )
private

The documentation for this class was generated from the following files: