IDA C++ SDK 9.2
Loading...
Searching...
No Matches
switch_info_t Struct Reference

Information about a switch statement. More...

#include <nalt.hpp>

Public Types

enum  { SWITCH_INFO_VERSION = 2 }

Public Member Functions

int get_shift (void) const
 See #SWI_SHIFT_MASK.
void set_shift (int shift)
 See #SWI_SHIFT_MASK.
int get_jtable_element_size (void) const
void set_jtable_element_size (int size)
int get_vtable_element_size (void) const
void set_vtable_element_size (int size)
bool has_default (void) const
bool has_elbase (void) const
bool is_sparse (void) const
bool is_custom (void) const
bool is_indirect (void) const
bool is_subtract (void) const
bool is_nolowcase (void) const
bool use_std_table (void) const
bool is_user_defined () const
sval_t get_lowcase (void) const
int get_jtable_size (void) const
void set_jtable_size (int size)
void set_elbase (ea_t base)
void set_expr (int r, op_dtype_t dt)
bool get_jrange_vrange (range_t *jrange=nullptr, range_t *vrange=nullptr) const
 get separate parts of the switch
int get_version () const
 switch_info_t ()
void clear ()

Public Attributes

uint32 flags
 Switch info flags
ushort ncases = 0
 number of cases (excluding default)
ea_t jumps = BADADDR
 jump table start address
union { 
   ea_t   values 
 values table address (if #SWI_SPARSE is set) More...
   uval_t   lowcase 
 the lowest value in cases More...
}; 
ea_t defjump = BADADDR
 default jump address (#BADADDR if no default case)
ea_t startea = BADADDR
 start of the switch idiom
int jcases = 0
 number of entries in the jump table (SWI_INDIRECT)
sval_t ind_lowcase = 0
ea_t elbase = 0
 element base
int regnum = -1
 the switch expression as a value of the REGNUM register before the instruction at EXPR_EA.
op_dtype_t regdtype = 0
 size of the switch expression register as dtype
uval_t custom = 0
 information for custom tables (filled and used by modules)
int version = SWITCH_INFO_VERSION
ea_t expr_ea = BADADDR
 the address before that the switch expression is in REGNUM.
eavec_t marks
 the insns marked as IM_SWITCH. They are used to delete the switch.

Detailed Description

Information about a switch statement.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SWITCH_INFO_VERSION 

Constructor & Destructor Documentation

◆ switch_info_t()

switch_info_t::switch_info_t ( )
inline

Member Function Documentation

◆ get_shift()

int switch_info_t::get_shift ( void ) const
inline

See #SWI_SHIFT_MASK.

possible answers: 0..3.

◆ set_shift()

void switch_info_t::set_shift ( int shift)
inline

See #SWI_SHIFT_MASK.

◆ get_jtable_element_size()

int switch_info_t::get_jtable_element_size ( void ) const
inline

◆ set_jtable_element_size()

void switch_info_t::set_jtable_element_size ( int size)
inline

◆ get_vtable_element_size()

int switch_info_t::get_vtable_element_size ( void ) const
inline

◆ set_vtable_element_size()

void switch_info_t::set_vtable_element_size ( int size)
inline

◆ has_default()

bool switch_info_t::has_default ( void ) const
inline

◆ has_elbase()

bool switch_info_t::has_elbase ( void ) const
inline

◆ is_sparse()

bool switch_info_t::is_sparse ( void ) const
inline

◆ is_custom()

bool switch_info_t::is_custom ( void ) const
inline

◆ is_indirect()

bool switch_info_t::is_indirect ( void ) const
inline

◆ is_subtract()

bool switch_info_t::is_subtract ( void ) const
inline

◆ is_nolowcase()

bool switch_info_t::is_nolowcase ( void ) const
inline

◆ use_std_table()

bool switch_info_t::use_std_table ( void ) const
inline

◆ is_user_defined()

bool switch_info_t::is_user_defined ( ) const
inline

◆ get_lowcase()

sval_t switch_info_t::get_lowcase ( void ) const
inline

◆ get_jtable_size()

int switch_info_t::get_jtable_size ( void ) const
inline

◆ set_jtable_size()

void switch_info_t::set_jtable_size ( int size)
inline

◆ set_elbase()

void switch_info_t::set_elbase ( ea_t base)
inline

◆ set_expr()

void switch_info_t::set_expr ( int r,
op_dtype_t dt )
inline

◆ get_jrange_vrange()

bool switch_info_t::get_jrange_vrange ( range_t * jrange = nullptr,
range_t * vrange = nullptr ) const
inline

get separate parts of the switch

◆ get_version()

int switch_info_t::get_version ( ) const
inline

◆ clear()

void switch_info_t::clear ( )
inline

Member Data Documentation

◆ flags

uint32 switch_info_t::flags

◆ ncases

ushort switch_info_t::ncases = 0

number of cases (excluding default)

◆ jumps

ea_t switch_info_t::jumps = BADADDR

jump table start address

◆ values

ea_t switch_info_t::values

values table address (if #SWI_SPARSE is set)

◆ lowcase

uval_t switch_info_t::lowcase

the lowest value in cases

◆ [union]

union { ... } switch_info_t

◆ defjump

ea_t switch_info_t::defjump = BADADDR

default jump address (#BADADDR if no default case)

◆ startea

ea_t switch_info_t::startea = BADADDR

start of the switch idiom

◆ jcases

int switch_info_t::jcases = 0

number of entries in the jump table (SWI_INDIRECT)

◆ ind_lowcase

sval_t switch_info_t::ind_lowcase = 0

◆ elbase

ea_t switch_info_t::elbase = 0

element base

◆ regnum

int switch_info_t::regnum = -1

the switch expression as a value of the REGNUM register before the instruction at EXPR_EA.

-1 means 'unknown'

◆ regdtype

op_dtype_t switch_info_t::regdtype = 0

size of the switch expression register as dtype

◆ custom

uval_t switch_info_t::custom = 0

information for custom tables (filled and used by modules)

◆ version

int switch_info_t::version = SWITCH_INFO_VERSION

◆ expr_ea

ea_t switch_info_t::expr_ea = BADADDR

the address before that the switch expression is in REGNUM.

If BADADDR, then the first insn marked as IM_SWITCH after STARTEA is used.

◆ marks

eavec_t switch_info_t::marks

the insns marked as IM_SWITCH. They are used to delete the switch.


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