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

Cursor item. More...

#include <hexrays.hpp>

Public Member Functions

void verify (const mba_t *mba) const
 
member_t * get_memptr (struc_t **p_sptr=nullptr) const
 Get pointer to structure member. More...
 
int get_udm (udm_t *udm=nullptr, tinfo_t *parent=nullptr, uint64 *p_offset=nullptr) const
 Get type of a structure field. More...
 
int get_edm (tinfo_t *parent) const
 Get type of an enum member. More...
 
lvar_tget_lvar () const
 Get pointer to local variable. More...
 
ea_t get_ea () const
 Get address of the current item. More...
 
int get_label_num (int gln_flags) const
 Get label number of the current item. More...
 
bool is_citem () const
 Is the current item is a ctree item? More...
 
void print (qstring *vout) const
 
const char * dstr () const
 

Public Attributes

cursor_item_type_t citype = VDI_NONE
 Item type. More...
 
union {
   citem_t *   it
 
   cexpr_t *   e
 VDI_EXPR: Expression. More...
 
   cinsn_t *   i
 VDI_EXPR: Statement. More...
 
   lvar_t *   l
 VDI_LVAR: Local variable. More...
 
   cfunc_t *   f
 VDI_FUNC: Function. More...
 
   treeloc_t   loc
 VDI_TAIL: Line tail. More...
 
}; 
 

Detailed Description

Cursor item.

Information about the item under the cursor

Definition at line 6666 of file hexrays.hpp.

Member Function Documentation

◆ dstr()

const char * ctree_item_t::dstr ( ) const

Definition at line 11999 of file hexrays.hpp.

◆ get_ea()

ea_t ctree_item_t::get_ea ( ) const

Get address of the current item.

Each ctree item has an address.

Returns
BADADDR if failed

Definition at line 11979 of file hexrays.hpp.

◆ get_edm()

int ctree_item_t::get_edm ( tinfo_t *  parent) const

Get type of an enum member.

If the current item is a symbolic constant, this function will return information about it.

Parameters
[out]parentpointer to buffer for the enum type.
Returns
member index or -1 if failed

Definition at line 11967 of file hexrays.hpp.

◆ get_label_num()

int ctree_item_t::get_label_num ( int  gln_flags) const

Get label number of the current item.

Parameters
[in]gln_flagsCombination of get_label_num control bits
Returns
-1 if failed or no label

Definition at line 11987 of file hexrays.hpp.

◆ get_lvar()

lvar_t * ctree_item_t::get_lvar ( ) const

Get pointer to local variable.

If the current item is a local variable, this function will return pointer to its definition.

Returns
nullptr if failed

Definition at line 11973 of file hexrays.hpp.

◆ get_memptr()

member_t * ctree_item_t::get_memptr ( struc_t **  p_sptr = nullptr) const

Get pointer to structure member.

If the current item is a structure field, this function will return pointer to its definition.

Parameters
[out]p_sptrpointer to the variable where the pointer to the parent structure is returned. This parameter can be nullptr.
Returns
nullptr if failed OBSOLETE FUNCTION, do not use!

Definition at line 11955 of file hexrays.hpp.

◆ get_udm()

int ctree_item_t::get_udm ( udm_t *  udm = nullptr,
tinfo_t *  parent = nullptr,
uint64 *  p_offset = nullptr 
) const

Get type of a structure field.

If the current item is a structure/union field, this function will return information about it.

Parameters
[out]udmpointer to buffer for the udt member info.
[out]parentpointer to buffer for the struct/union type.
[out]p_offsetpointer to the offset in bits inside udt.
Returns
member index or -1 if failed Both output parameters can be nullptr.

Definition at line 11961 of file hexrays.hpp.

◆ is_citem()

bool ctree_item_t::is_citem ( ) const

Is the current item is a ctree item?

Examples
hexrays_sample17.cpp, hexrays_sample3.cpp, and hexrays_sample5.cpp.

Definition at line 6741 of file hexrays.hpp.

References VDI_EXPR.

◆ print()

void ctree_item_t::print ( qstring *  vout) const

Definition at line 11993 of file hexrays.hpp.

Member Data Documentation

◆ citype

cursor_item_type_t ctree_item_t::citype = VDI_NONE

Item type.

Examples
hexrays_sample3.cpp.

Definition at line 6668 of file hexrays.hpp.

◆ e

cexpr_t* ctree_item_t::e

VDI_EXPR: Expression.

Examples
hexrays_sample17.cpp, and hexrays_sample5.cpp.

Definition at line 6672 of file hexrays.hpp.

◆ f

cfunc_t* ctree_item_t::f

VDI_FUNC: Function.

Definition at line 6675 of file hexrays.hpp.

◆ i

cinsn_t* ctree_item_t::i

VDI_EXPR: Statement.

Examples
hexrays_sample3.cpp.

Definition at line 6673 of file hexrays.hpp.

◆ it

citem_t* ctree_item_t::it

Definition at line 6671 of file hexrays.hpp.

◆ l

lvar_t* ctree_item_t::l

VDI_LVAR: Local variable.

Definition at line 6674 of file hexrays.hpp.

◆ loc

treeloc_t ctree_item_t::loc

VDI_TAIL: Line tail.

Examples
hexrays_sample3.cpp.

Definition at line 6676 of file hexrays.hpp.