Latest available version: IDA and decompilers v8.4.240320sp1 see all releases
Hex-Rays logo State-of-the-art binary code analysis tools
email icon

Describes an argument location. More...

#include <typeinf.hpp>

Inherited by argpart_t.

Public Types

typedef size_t biggest_t
 

Public Member Functions

 argloc_t ()
 Constructor.
 
 argloc_t (const argloc_t &r)
 Constructor.
 
 ~argloc_t ()
 Destructor.
 
argloc_toperator= (const argloc_t &r)
 Constructor.
 
void swap (argloc_t &r)
 Assign this == r and r == this.
 
const char * dstr () const
 
argloc_type_t atype () const
 Get type (Argument location types)
 
bool is_reg1 () const
 See ALOC_REG1.
 
bool is_reg2 () const
 See ALOC_REG2.
 
bool is_reg () const
 is_reg1() || is_reg2()
 
bool is_rrel () const
 See ALOC_RREL.
 
bool is_ea () const
 See ALOC_STATIC.
 
bool is_stkoff () const
 See ALOC_STACK.
 
bool is_scattered () const
 See ALOC_DIST.
 
bool has_reg () const
 TRUE if argloc has a register part.
 
bool has_stkoff () const
 TRUE if argloc has a stack part.
 
bool is_mixed_scattered () const
 mixed scattered: consists of register and stack parts
 
bool in_stack () const
 TRUE if argloc is in stack entirely.
 
bool is_fragmented () const
 is_scattered() || is_reg2()
 
bool is_custom () const
 See ALOC_CUSTOM.
 
bool is_badloc () const
 See ALOC_NONE.
 
int reg1 () const
 Get the register info. More...
 
int regoff () const
 Get offset from the beginning of the register in bytes. More...
 
int reg2 () const
 Get info for the second register. More...
 
uint32 get_reginfo () const
 Get all register info. More...
 
sval_t stkoff () const
 Get the stack offset. More...
 
ea_t get_ea () const
 Get the global address. More...
 
scattered_aloc_tscattered ()
 Get scattered argument info. More...
 
const scattered_aloc_tscattered () const
 Get scattered argument info. More...
 
rrel_tget_rrel ()
 Get register-relative info. More...
 
const rrel_tget_rrel () const
 Get register-relative info. More...
 
void * get_custom () const
 Get custom argloc info. More...
 
biggest_t get_biggest () const
 Get largest element in internal union.
 
void _set_badloc ()
 Use set_badloc()
 
void _set_reg1 (int reg, int off=0)
 Use set_reg1()
 
void _set_reg2 (int _reg1, int _reg2)
 Use set_reg2()
 
void _set_stkoff (sval_t off)
 Use set_stkoff()
 
void _set_ea (ea_t _ea)
 Use set_ea.
 
bool _consume_rrel (rrel_t *p)
 Use consume_rrel()
 
bool _consume_scattered (scattered_aloc_t *p)
 Use consume_scattered()
 
void _set_custom (argloc_type_t ct, void *pdata)
 Set custom argument location (careful - this function does not clean up!)
 
void _set_biggest (argloc_type_t ct, biggest_t data)
 Set biggest element in internal union (careful - this function does not clean up!)
 
void set_reg1 (int reg, int off=0)
 Set register location.
 
void set_reg2 (int _reg1, int _reg2)
 Set secondary register location.
 
void set_stkoff (sval_t off)
 Set stack offset location.
 
void set_ea (ea_t _ea)
 Set static ea location.
 
void consume_rrel (rrel_t *p)
 Set register-relative location - can't be nullptr.
 
void consume_scattered (scattered_aloc_t *p)
 Set distributed argument location.
 
void set_badloc ()
 Set to invalid location.
 
sval_t calc_offset () const
 Calculate offset that can be used to compare 2 similar arglocs.
 
bool advance (int delta)
 Move the location to point 'delta' bytes further.
 
void align_reg_high (size_t size, size_t _slotsize)
 Set register offset to align it to the upper part of _SLOTSIZE.
 
void align_stkoff_high (size_t size, size_t _slotsize)
 Set stack offset to align to the upper part of _SLOTSIZE.
 

Detailed Description

Describes an argument location.

A typical argument is stored in one location, either a register or a stack slot.
However, some arguments can be stored in multiple locations, for example in a pair
of registers. In some really complex cases an argument can be located in multiple
registers and some stack slots. This class can describe all these cases.

Member Function Documentation

◆ reg1()

int argloc_t::reg1 ( ) const
inline

Get the register info.

Use when atype() == ALOC_REG1 or ALOC_REG2

◆ regoff()

int argloc_t::regoff ( ) const
inline

Get offset from the beginning of the register in bytes.

Use when atype() == ALOC_REG1

◆ reg2()

int argloc_t::reg2 ( ) const
inline

Get info for the second register.

Use when atype() == ALOC_REG2

◆ get_reginfo()

uint32 argloc_t::get_reginfo ( ) const
inline

Get all register info.

Use when atype() == ALOC_REG1 or ALOC_REG2

◆ stkoff()

sval_t argloc_t::stkoff ( ) const
inline

Get the stack offset.

Use if atype() == ALOC_STACK

◆ get_ea()

ea_t argloc_t::get_ea ( ) const
inline

Get the global address.

Use when atype() == ALOC_STATIC

◆ scattered() [1/2]

scattered_aloc_t & argloc_t::scattered ( )
inline

Get scattered argument info.

Use when atype() == ALOC_DIST

◆ scattered() [2/2]

const scattered_aloc_t & argloc_t::scattered ( ) const
inline

Get scattered argument info.

Use when atype() == ALOC_DIST

◆ get_rrel() [1/2]

rrel_t & argloc_t::get_rrel ( )
inline

Get register-relative info.

Use when atype() == ALOC_RREL

◆ get_rrel() [2/2]

const rrel_t & argloc_t::get_rrel ( ) const
inline

Get register-relative info.

Use when atype() == ALOC_RREL

◆ get_custom()

void * argloc_t::get_custom ( ) const
inline

Get custom argloc info.

Use if atype() == ALOC_CUSTOM


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