IDA C++ SDK 9.2
Loading...
Searching...
No Matches
custom_callcnv_t Struct Referenceabstract

Description of a custom calling convention. More...

#include <typeinf.hpp>

Public Member Functions

bool is_vararg () const
bool is_purging () const
bool is_usercall () const
virtual bool validate_func (const func_type_data_t &fti, qstring *reterr) const
 Validate a function prototype.
virtual bool calc_retloc (func_type_data_t *fti) const =0
 Calculate the location of the return value.
virtual bool calc_arglocs (func_type_data_t *fti) const =0
 Calculate the argument locations.
virtual ssize_t find_varargs (func_type_data_t *fti, ea_t call_ea, class mblock_t *blk) const
 Discover variadic arguments.
virtual bool calc_varglocs (func_type_data_t *fti, regobjs_t *regs, relobj_t *stkargs, int nfixed) const
 Calculate the argument locations for a variadic function.
virtual bool get_cc_regs (callregs_t *out) const
 Retrieve generic information about call registers.
virtual bool get_stkarg_area_info (stkarg_area_info_t *out) const
 Retrieve generic information about stack arguments.
virtual int calc_purged_bytes (const func_type_data_t &fti, ea_t call_ea=BADADDR) const
 Calculate the number of purged bytes.
virtual bool decorate_name (qstring *outbuf, const char *name, bool should_decorate, callcnv_t cc, const tinfo_t &type) const
 Decorate a function name.
virtual int lower_func_type (func_type_data_t *fti) const
 Lower a function type.
 custom_callcnv_t ()=default
 custom_callcnv_t (const char *_name, uint64 f, uint32 _abibits)
virtual ~custom_callcnv_t ()
 DECLARE_COMPARISONS (custom_callcnv_t)

Public Attributes

int cbsize = sizeof(*this)
uint64 flags = 0
qstring name
 the name is used as a keyword in the function prototype
uint32 abibits = 0
 abibits to be used for the calling convention

Detailed Description

Description of a custom calling convention.

Constructor & Destructor Documentation

◆ custom_callcnv_t() [1/2]

custom_callcnv_t::custom_callcnv_t ( )
default

◆ custom_callcnv_t() [2/2]

custom_callcnv_t::custom_callcnv_t ( const char * _name,
uint64 f,
uint32 _abibits )
inline

◆ ~custom_callcnv_t()

virtual custom_callcnv_t::~custom_callcnv_t ( )
inlinevirtual

Member Function Documentation

◆ is_vararg()

bool custom_callcnv_t::is_vararg ( ) const
inline

◆ is_purging()

bool custom_callcnv_t::is_purging ( ) const
inline

◆ is_usercall()

bool custom_callcnv_t::is_usercall ( ) const
inline

◆ validate_func()

virtual bool custom_callcnv_t::validate_func ( const func_type_data_t & fti,
qstring * reterr ) const
inlinevirtual

Validate a function prototype.

This function is used during parsing or deserializing a function prototype to verify semantic limitations of the prototype (for example, returning arrays is forbidden in C)

Parameters
[in]ftifunction prototype
[out]reterrbuffer for error message

◆ calc_retloc()

virtual bool custom_callcnv_t::calc_retloc ( func_type_data_t * fti) const
pure virtual

Calculate the location of the return value.

This function must fill fti->retloc.

Parameters
ftifunction prototype
Returns
success

◆ calc_arglocs()

virtual bool custom_callcnv_t::calc_arglocs ( func_type_data_t * fti) const
pure virtual

Calculate the argument locations.

This function must fill all fti->at(i).argloc instances. It may be called for variadic functions too, in calc_varglocs fails.

Parameters
ftifunction prototype
Returns
success

◆ find_varargs()

virtual ssize_t custom_callcnv_t::find_varargs ( func_type_data_t * fti,
ea_t call_ea,
class mblock_t * blk ) const
inlinevirtual

Discover variadic arguments.

This function is called only for variadic functions. It is currently used by the decompiler.

Parameters
ftifunction prototype. find_varargs() should append the discovered variadic arguments to it.
call_eaaddress of the call instruction
blkmicrocode block with the call instruction
Returns
>0 - total number of arguments after the call <0 - failure ==0 - means to use the standard algorithm to discover variadic args

◆ calc_varglocs()

virtual bool custom_callcnv_t::calc_varglocs ( func_type_data_t * fti,
regobjs_t * regs,
relobj_t * stkargs,
int nfixed ) const
inlinevirtual

Calculate the argument locations for a variadic function.

This function must fill all fti->at(i).argloc instances and provide more detailed info about registers and stkargs.

Parameters
ftifunction prototype
[out]regsbuffer for hidden register arguments, may be nullptr
[out]stkargsbuffer for hidden stack arguments, may be nullptr
nfixednumber of fixed arguments
Returns
success

◆ get_cc_regs()

virtual bool custom_callcnv_t::get_cc_regs ( callregs_t * out) const
inlinevirtual

Retrieve generic information about call registers.

◆ get_stkarg_area_info()

virtual bool custom_callcnv_t::get_stkarg_area_info ( stkarg_area_info_t * out) const
inlinevirtual

Retrieve generic information about stack arguments.

◆ calc_purged_bytes()

virtual int custom_callcnv_t::calc_purged_bytes ( const func_type_data_t & fti,
ea_t call_ea = BADADDR ) const
inlinevirtual

Calculate the number of purged bytes.

Parameters
ftifunction prototype
call_eaaddress of the call instruction (not used yet)

◆ lower_func_type()

virtual int custom_callcnv_t::lower_func_type ( func_type_data_t * fti) const
inlinevirtual

Lower a function type.

See lower_type() for more explanations.

Parameters
ftifunction prototype
Returns
<0-failure, >=0-ok, 2-made substantial changes

◆ DECLARE_COMPARISONS()

custom_callcnv_t::DECLARE_COMPARISONS ( custom_callcnv_t )

Member Data Documentation

◆ cbsize

int custom_callcnv_t::cbsize = sizeof(*this)

◆ flags

uint64 custom_callcnv_t::flags = 0

◆ name

qstring custom_callcnv_t::name

the name is used as a keyword in the function prototype

◆ abibits

uint32 custom_callcnv_t::abibits = 0

abibits to be used for the calling convention


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