IDA C++ SDK 9.2
|
Definition of a local variable (register or stack) #var #lvar. More...
#include <hexrays.hpp>
Public Member Functions | |
lvar_t () | |
lvar_t (const qstring &n, const vdloc_t &l, ea_t e, const tinfo_t &t, int w, int db) | |
const char *hexapi | dstr () const |
bool | used () const |
Is the variable used in the code? | |
bool | typed () const |
Has the variable a type? | |
bool | mreg_done () const |
Have corresponding microregs been replaced by references to this variable? | |
bool | has_nice_name () const |
Does the variable have a nice name? | |
bool | is_unknown_width () const |
Do we know the width of the variable? | |
bool | has_user_info () const |
Has any user-defined information? | |
bool | has_user_name () const |
Has user-defined name? | |
bool | has_user_type () const |
Has user-defined type? | |
bool | is_result_var () const |
Is the function result? | |
bool | is_arg_var () const |
Is the function argument? | |
bool hexapi | is_promoted_arg () const |
Is the promoted function argument? | |
bool | is_fake_var () const |
Is fake return variable? | |
bool | is_overlapped_var () const |
Is overlapped variable? | |
bool | is_floating_var () const |
Used by a fpu insn? | |
bool | is_spoiled_var () const |
Is spoiled var? (meaningful only during lvar allocation) | |
bool | is_partialy_typed () const |
Variable type should be handled as a partial one. | |
bool | is_noptr_var () const |
Variable type should not be a pointer. | |
bool | is_mapdst_var () const |
Other variable(s) map to this var? | |
bool | is_thisarg () const |
Is 'this' argument of a C++ member function? | |
bool | is_split_var () const |
Is a split variable? | |
bool | has_regname () const |
Has a register name? (like _RAX) | |
bool | in_asm () const |
Is variable used in an instruction translated into __asm? | |
bool | is_dummy_arg () const |
Is a dummy argument (added to fill a hole in the argument list) | |
bool | is_notarg () const |
Is a local variable? (local variable cannot be an input argument) | |
bool | is_automapped () const |
Was the variable automatically mapped to another variable? | |
bool | is_used_byref () const |
Was the address of the variable taken? | |
bool | is_decl_unused () const |
Was declared as __unused by the user? See CVAR_UNUSED. | |
bool | is_shared () const |
Is lvar mapped to several chains. | |
bool | was_scattered_arg () const |
Was lvar transformed from a scattered argument? | |
void | set_used () |
void | clear_used () |
void | set_typed () |
void | set_non_typed () |
void | clr_user_info () |
void | set_user_name () |
void | set_user_type () |
void | clr_user_type () |
void | clr_user_name () |
void | set_mreg_done () |
void | clr_mreg_done () |
void | set_unknown_width () |
void | clr_unknown_width () |
void | set_arg_var () |
void | clr_arg_var () |
void | set_fake_var () |
void | clr_fake_var () |
void | set_overlapped_var () |
void | clr_overlapped_var () |
void | set_floating_var () |
void | clr_floating_var () |
void | set_spoiled_var () |
void | clr_spoiled_var () |
void | set_mapdst_var () |
void | clr_mapdst_var () |
void | set_partialy_typed () |
void | clr_partialy_typed () |
void | set_noptr_var () |
void | clr_noptr_var () |
void | set_thisarg () |
void | clr_thisarg () |
void | set_split_var () |
void | clr_split_var () |
void | set_dummy_arg () |
void | clr_dummy_arg () |
void | set_notarg () |
void | clr_notarg () |
void | set_automapped () |
void | clr_automapped () |
void | set_used_byref () |
void | clr_used_byref () |
void | set_decl_unused () |
void | clr_decl_unused () |
void | set_shared () |
void | clr_shared () |
void | set_scattered_arg () |
void | clr_scattered_arg () |
bool | has_common (const lvar_t &v) const |
Do variables overlap? | |
bool | has_common_bit (const vdloc_t &loc, asize_t width2) const |
Does the variable overlap with the specified location? | |
const tinfo_t & | type () const |
Get variable type. | |
tinfo_t & | type () |
bool hexapi | accepts_type (const tinfo_t &t, bool may_change_thisarg=false) |
Check if the variable accept the specified type. | |
bool hexapi | set_lvar_type (const tinfo_t &t, bool may_fail=false) |
Set variable type Note: this function does not modify the idb, only the lvar instance in the memory. | |
void | set_final_lvar_type (const tinfo_t &t) |
Set final variable type. | |
bool hexapi | set_width (int w, int svw_flags=0) |
Change the variable width. | |
void hexapi | append_list (const mba_t *mba, mlist_t *lst, bool pad_if_scattered=false) const |
Append local variable to mlist. | |
bool | is_aliasable (const mba_t *mba) const |
Is the variable aliasable? | |
Public Member Functions inherited from lvar_locator_t | |
lvar_locator_t () | |
lvar_locator_t (const vdloc_t &loc, ea_t ea) | |
sval_t | get_stkoff () const |
Get offset of the varialbe in the stack frame. | |
bool | is_reg1 () const |
Is variable located on one register? | |
bool | is_reg2 () const |
Is variable located on two registers? | |
bool | is_reg_var () const |
Is variable located on register(s)? | |
bool | is_stk_var () const |
Is variable located on the stack? | |
bool | is_scattered () const |
Is variable scattered? | |
mreg_t | get_reg1 () const |
Get the register number of the variable. | |
mreg_t | get_reg2 () const |
Get the number of the second register (works only for ALOC_REG2 lvars) | |
const scattered_aloc_t & | get_scattered () const |
Get information about scattered variable. | |
scattered_aloc_t & | get_scattered () |
DECLARE_COMPARISONS (lvar_locator_t) | |
HEXRAYS_MEMORY_ALLOCATION_FUNCS () const char *hexapi dstr() const |
Public Attributes | |
qstring | name |
variable name. | |
qstring | cmt |
variable comment string | |
tinfo_t | tif |
variable type | |
int | width = 0 |
variable size in bytes | |
int | defblk = -1 |
first block defining the variable. | |
uint64 | divisor = 0 |
max known divisor of the variable | |
Public Attributes inherited from lvar_locator_t | |
vdloc_t | location |
Variable location. | |
ea_t | defea = BADADDR |
Definition address. |
Friends | |
class | mba_t |
Definition of a local variable (register or stack) #var #lvar.
|
inline |
|
inline |
|
inline |
|
inline |
Is the variable used in the code?
|
inline |
Has the variable a type?
|
inline |
Have corresponding microregs been replaced by references to this variable?
|
inline |
Does the variable have a nice name?
|
inline |
Do we know the width of the variable?
|
inline |
Has any user-defined information?
|
inline |
Has user-defined name?
|
inline |
Has user-defined type?
|
inline |
Is the function result?
|
inline |
Is the function argument?
|
inline |
Is the promoted function argument?
|
inline |
Is fake return variable?
|
inline |
Is overlapped variable?
|
inline |
Used by a fpu insn?
|
inline |
Is spoiled var? (meaningful only during lvar allocation)
|
inline |
Variable type should be handled as a partial one.
|
inline |
Variable type should not be a pointer.
|
inline |
Other variable(s) map to this var?
|
inline |
Is 'this' argument of a C++ member function?
|
inline |
Is a split variable?
|
inline |
Has a register name? (like _RAX)
|
inline |
Is variable used in an instruction translated into __asm?
|
inline |
Is a dummy argument (added to fill a hole in the argument list)
|
inline |
Is a local variable? (local variable cannot be an input argument)
|
inline |
Was the variable automatically mapped to another variable?
|
inline |
Was the address of the variable taken?
|
inline |
Was declared as __unused by the user? See CVAR_UNUSED.
|
inline |
Is lvar mapped to several chains.
|
inline |
Was lvar transformed from a scattered argument?
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Does the variable overlap with the specified location?
|
inline |
Get variable type.
|
inline |
Check if the variable accept the specified type.
Some types are forbidden (void, function types, wrong arrays, etc)
Set variable type Note: this function does not modify the idb, only the lvar instance in the memory.
For permanent changes see modify_user_lvars() Also, the variable type is not considered as final by the decompiler and may be modified later by the type derivation. In some cases set_final_var_type() may work better, but it does not do persistent changes to the database neither.
t | new type |
may_fail | if false and type is bad, interr |
|
inline |
Change the variable width.
We call the variable size 'width', it is represents the number of bytes. This function may change the variable type using set_lvar_type().
w | new width |
svw_flags | combination of SVW_... bits |
|
inline |
Append local variable to mlist.
mba | ptr to the current mba_t |
lst | list to append to |
pad_if_scattered | if true, append padding bytes in case of scattered lvar |
Is the variable aliasable?
mba | ptr to the current mba_t Aliasable variables may be modified indirectly (through a pointer) |
|
friend |
qstring lvar_t::name |
variable name.
use mba_t::set_nice_lvar_name() and mba_t::set_user_lvar_name() to modify it
qstring lvar_t::cmt |
variable comment string
tinfo_t lvar_t::tif |
variable type
int lvar_t::width = 0 |
variable size in bytes
int lvar_t::defblk = -1 |
first block defining the variable.
0 for args, -1 if unknown
uint64 lvar_t::divisor = 0 |
max known divisor of the variable