104#define DEFMASK64 bmask64_t(-1)
118struct tinfo_changes_t;
121#define RESERVED_BYTE 0xFF
543#define MAX_DECL_ALIGN 0x000F
547#define TAH_HASATTRS 0x0010
552#define TAUDT_UNALIGNED 0x0040
553#define TAUDT_MSSTRUCT 0x0020
554#define TAUDT_CPPOBJ 0x0080
555#define TAUDT_VFTABLE 0x0100
556#define TAUDT_FIXED 0x0400
558#define TAUDT_TUPLE 0x0800
560#define TAUDT_IFACE 0x1000
565#define TAFLD_BASECLASS 0x0020
566#define TAFLD_UNALIGNED 0x0040
567#define TAFLD_VIRTBASE 0x0080
568#define TAFLD_VFTABLE 0x0100
569#define TAFLD_METHOD 0x0200
570#define TAFLD_GAP 0x0400
571#define TAFLD_REGCMT 0x0800
572#define TAFLD_FRAME_R 0x1000
573#define TAFLD_FRAME_S 0x2000
574#define TAFLD_BYTIL 0x4000
579#define TAPTR_PTR32 0x0020
580#define TAPTR_PTR64 0x0040
581#define TAPTR_RESTRICT 0x0060
582#define TAPTR_SHIFTED 0x0080
587#define TAENUM_64BIT 0x0020
588#define TAENUM_UNSIGNED 0x0040
589#define TAENUM_SIGNED 0x0080
590#define TAENUM_OCT 0x0100
591#define TAENUM_BIN 0x0200
594#define TAENUM_NUMSIGN 0x0400
595#define TAENUM_LZERO 0x0800
598#define TAH_ALL 0x7FF0
608 return t == TAH_BYTE;
635 for (
size_t i=0; i <
n; i++ )
655#define TA_ORG_TYPEDEF "__org_typedef"
656#define TA_ORG_ARRDIM "__org_arrdim"
657#define TA_FORMAT "format"
662#define TA_VALUE_REPR "\x01"
737#define TIL_ZIP 0x0001
738#define TIL_MAC 0x0002
739#define TIL_ESI 0x0004
740#define TIL_UNI 0x0008
741#define TIL_ORD 0x0010
742#define TIL_ALI 0x0020
743#define TIL_MOD 0x0040
744#define TIL_STM 0x0080
745#define TIL_SLD 0x0100
746#define TIL_ECC 0x0200
760 for (
int i = 0; i <
nbases; ++i )
796#define TIL_ADD_FAILED 0
798#define TIL_ADD_ALREADY 2
837idaman
bool ida_export
store_til(
til_t *ti,
const char *tildir,
const char *name);
938#define ARGLOC_HELPER_DEFINITIONS(decl) \
939decl void ida_export copy_argloc(argloc_t *dst, const argloc_t *src); \
940decl void ida_export cleanup_argloc(argloc_t *vloc);\
941decl int ida_export compare_arglocs(const argloc_t &a, const argloc_t &b);
943#define ARGLOC_HELPER_DEFINITIONS(decl)
945ARGLOC_HELPER_DEFINITIONS(idaman)
953typedef int argloc_type_t;
1120 ARGLOC_HELPER_DEFINITIONS(
friend)
1124 argloc_t(
const argloc_t &r) : type(
ALOC_NONE) { copy_argloc(
this, &r); }
1125 ~argloc_t() { cleanup_argloc(
this); }
1126 argloc_t &operator=(
const argloc_t &r) { copy_argloc(
this, &r);
return *
this; }
1127 DEFINE_MEMORY_ALLOCATION_FUNCS()
1133 argloc_type_t
t = type; type = r.type; r.type =
t;
1136 const char *dstr()
const;
1138 argloc_type_t atype()
const {
return type; }
1139 bool is_reg1()
const {
return type ==
ALOC_REG1; }
1140 bool is_reg2()
const {
return type ==
ALOC_REG2; }
1142 bool is_rrel()
const {
return type ==
ALOC_RREL; }
1143 bool is_ea()
const {
return type ==
ALOC_STATIC; }
1144 bool is_stkoff()
const {
return type ==
ALOC_STACK; }
1145 bool is_scattered()
const {
return type ==
ALOC_DIST; }
1146 inline bool has_reg()
const;
1147 inline bool has_stkoff()
const;
1148 inline bool is_mixed_scattered()
const;
1149 inline bool in_stack()
const;
1151 bool is_custom()
const {
return type >=
ALOC_CUSTOM; }
1152 bool is_badloc()
const {
return type ==
ALOC_NONE; }
1176 ea_t get_ea()
const {
return sval; }
1180 scattered_aloc_t &scattered() {
return *
dist; }
1181 const scattered_aloc_t &scattered()
const {
return *
dist; }
1185 rrel_t &get_rrel() {
return *
rrel; }
1186 const rrel_t &get_rrel()
const {
return *
rrel; }
1190 void *get_custom()
const {
return custom; }
1196 void _set_badloc() { type =
ALOC_NONE; }
1197 void _set_reg1(
int reg,
int off=0) { type =
ALOC_REG1;
reginfo = reg | (off << 16); }
1198 void _set_reg2(
int _reg1,
int _reg2) { type =
ALOC_REG2;
reginfo = _reg1 | (_reg2 << 16); }
1202 bool _consume_rrel(rrel_t *p)
1211 bool _consume_scattered(scattered_aloc_t *p)
1221 void _set_custom(argloc_type_t
ct,
void *pdata) { type =
ct;
custom = pdata; }
1227 void set_reg1(
int reg,
int off=0) { cleanup_argloc(
this); _set_reg1(reg, off); }
1230 void set_reg2(
int _reg1,
int _reg2) { cleanup_argloc(
this); _set_reg2(_reg1, _reg2); }
1233 void set_stkoff(
sval_t off) { cleanup_argloc(
this); _set_stkoff(off); }
1236 void set_ea(
ea_t _ea) { cleanup_argloc(
this); _set_ea(_ea); }
1239 void consume_rrel(rrel_t *p) { cleanup_argloc(
this); _consume_rrel(p); }
1242 void consume_scattered(scattered_aloc_t *p) { cleanup_argloc(
this); _consume_scattered(p); }
1245 void set_badloc() { cleanup_argloc(
this); }
1248 sval_t calc_offset()
const
1268 bool advance(
int delta)
1273 _set_reg1(reg1()+delta, regoff());
1289 void align_reg_high(
size_t size,
size_t _slotsize)
1292 _set_reg1(reg1(),
size < _slotsize ?
int(_slotsize -
size) : 0);
1296 void align_stkoff_high(
size_t size,
size_t _slotsize)
1301 if (
size < _slotsize )
1302 off += _slotsize -
size;
1307 DECLARE_COMPARISONS(argloc_t)
1309 return compare_arglocs(*
this, r);
1380#define PRALOC_VERIFY 0x01
1381#define PRALOC_STKOFF 0x02
1556#define CCI_VARARG 0x0001
1557#define CCI_PURGE 0x0002
1558#define CCI_USER 0x0004
1653 ea_t call_ea=BADADDR)
const
1667 bool should_decorate,
1744 bool set_inds(
int *p_ind1,
int *p_ind2,
int ind)
const
1754 static void set_regarray(
intvec_t *regvec,
const int *regarray)
1757 if ( regarray !=
nullptr )
1758 while ( *regarray != -1 )
1799 if ( ccc ==
nullptr )
1813 set_regarray(&
gpregs, gprs);
1814 set_regarray(&
fpregs, fprs);
1823 size_t n = regvec.
size();
1824 regvec.
resize(
n + last_reg - first_reg + 1);
1825 for (
int i = first_reg; i <= last_reg; ++i )
1826 regvec[
n + i - first_reg] = i;
1852 return p == regs.
end() ? -1 :
int(p-regs.
begin());
1857 bool reginds(
int *gp_ind,
int *fp_ind,
int r)
const
1867 *gp_ind = *fp_ind = -1;
1868 return set_inds(gp_ind, fp_ind,
findreg(gprs, r))
1869 || set_inds(fp_ind, gp_ind,
findreg(fprs, r));
1960 const char *abiname=
nullptr);
1964#define SETCOMP_OVERRIDE 0x0001
1965#define SETCOMP_ONLY_ID 0x0002
1968#define SETCOMP_ONLY_ABI 0x0004
1969#define SETCOMP_BY_USER 0x0008
1984inline bool idaapi
set_abi_name(
const char *abiname,
bool user_level =
false)
1988 int flags = SETCOMP_ONLY_ABI | (user_level ? SETCOMP_BY_USER : 0);
2044#define MAX_FUNC_ARGS 256
2045#define MAX_ARRAY_NELEMS 0x7FFFFFFF
2073#define HTI_CPP 0x00000001
2074#define HTI_INT 0x00000002
2075#define HTI_EXT 0x00000004
2076#define HTI_LEX 0x00000008
2077#define HTI_UNP 0x00000010
2078#define HTI_TST 0x00000020
2079#define HTI_FIL 0x00000040
2081#define HTI_MAC 0x00000080
2082#define HTI_NWR 0x00000100
2083#define HTI_NER 0x00000200
2084#define HTI_DCL 0x00000400
2085#define HTI_NDC 0x00000800
2086#define HTI_PAK 0x00007000
2087#define HTI_PAK_SHIFT 12
2091#define HTI_PAKDEF 0x00000000
2092#define HTI_PAK1 0x00001000
2093#define HTI_PAK2 0x00002000
2094#define HTI_PAK4 0x00003000
2095#define HTI_PAK8 0x00004000
2096#define HTI_PAK16 0x00005000
2097#define HTI_HIGH 0x00008000
2099#define HTI_LOWER 0x00010000
2100#define HTI_RAWARGS 0x00020000
2101#define HTI_RELAXED 0x00080000
2102#define HTI_NOBASE 0x00100000
2103#define HTI_SEMICOLON 0x00200000
2104#define HTI_STANDALONE 0x00400000
2108#define HTI_VOID_OK 0x00800000
2109#define HTI_NO_MANGLE 0x01000000
2154 printer_t *print_cb=
nullptr,
2155 void *_cb_data=
nullptr,
2165 return ((pt_flags >> 4) & 0x1f) << HTI_PAK_SHIFT;
2191#define PT_SIL 0x00000001
2192#define PT_NDC 0x00000002
2193#define PT_TYP 0x00000004
2194#define PT_VAR 0x00000008
2195#define PT_PACKMASK 0x00000070
2196#define PT_HIGH 0x00000080
2198#define PT_LOWER 0x00000100
2199#define PT_REPLACE 0x00000200
2200#define PT_RAWARGS 0x00000400
2201#define PT_RELAXED 0x00001000
2202#define PT_EMPTY 0x00002000
2203#define PT_SEMICOLON 0x00004000
2204#define PT_SYMBOL 0x00008000
2206#define PT_VOID_OK 0x00010000
2207#define PT_NO_MANGLE 0x00020000
2239#define PRTYPE_1LINE 0x00000
2240#define PRTYPE_MULTI 0x00001
2241#define PRTYPE_TYPE 0x00002
2242#define PRTYPE_PRAGMA 0x00004
2243#define PRTYPE_SEMI 0x00008
2244#define PRTYPE_CPP 0x00010
2245#define PRTYPE_DEF 0x00020
2246#define PRTYPE_NOARGS 0x00040
2247#define PRTYPE_NOARRS 0x00080
2248#define PRTYPE_NORES 0x00100
2249#define PRTYPE_RESTORE 0x00200
2250#define PRTYPE_NOREGEX 0x00400
2251#define PRTYPE_COLORED 0x00800
2252#define PRTYPE_METHODS 0x01000
2253#define PRTYPE_1LINCMT 0x02000
2254#define PRTYPE_HEADER 0x04000
2255#define PRTYPE_OFFSETS 0x08000
2256#define PRTYPE_MAXSTR 0x10000
2257#define PRTYPE_TAIL 0x20000
2258#define PRTYPE_ARGLOCS 0x40000
2293 const p_list **fields=
nullptr,
2294 const char **cmt=
nullptr,
2295 const p_list **fieldcmts=
nullptr,
2301#define NTF_TYPE 0x00000001
2302#define NTF_SYMU 0x00000008
2303#define NTF_SYMM 0x00000000
2305#define NTF_NOBASE 0x00000002
2306#define NTF_REPLACE 0x00000004
2307#define NTF_UMANGLED 0x00000008
2308#define NTF_NOCUR 0x00000020
2309#define NTF_64BIT 0x00000040
2310#define NTF_FIXNAME 0x00000080
2312#define NTF_IDBENC 0x00000100
2315#define NTF_CHKSYNC 0x00000200
2317#define NTF_NO_NAMECHK 0x00000400
2319#define NTF_COPY 0x00001000
2327#define TPOS_REGCMT '\x06'
2339 const p_list **fields=
nullptr,
2340 const char **cmt=
nullptr,
2341 const p_list **fieldcmts=
nullptr,
2346 type, fields, cmt, fieldcmts, sclass, (
uint32 *)value);
2438 const til_t *srctil,
2451 bool should_decorate,
2459 bool should_decorate,
2467 bool should_decorate,
2515 const p_list **fields=
nullptr,
2516 const char **cmt=
nullptr,
2517 const p_list **fieldcmts=
nullptr,
2551 return maxord == 0 || maxord ==
uint32(-1) ? 0 : maxord - 1;
2677inline THREAD_SAFE
void align_size(
size_t &cur_tot_size,
size_t elem_size,
size_t algn)
2679 size_t al = elem_size;
2680 if ( algn != 0 && algn < al )
2682 cur_tot_size =
align_up(cur_tot_size,
int(al));
2696 ea_t *closure_obj=
nullptr);
2712idaman
int ida_export
add_til(
const char *name,
int flags);
2717#define ADDTIL_DEFAULT 0x0000
2718#define ADDTIL_INCOMP 0x0001
2719#define ADDTIL_SILENT 0x0002
2725#define ADDTIL_FAILED 0
2727#define ADDTIL_COMP 2
2728#define ADDTIL_ABORTED 3
2761#define TINFO_GUESSED 0x0000
2762#define TINFO_DEFINITE 0x0001
2763#define TINFO_DELAYFUNC 0x0002
2766#define TINFO_STRICT 0x0004
2837#define GUESS_FUNC_FAILED 0
2838#define GUESS_FUNC_TRIVIAL 1
2839#define GUESS_FUNC_OK 2
2879 size_t *out_alsize=
nullptr);
2985#define SUDT_SORT 0x0001
2986#define SUDT_ALIGN 0x0002
2988#define SUDT_GAPS 0x0004
2989#define SUDT_UNEX 0x0008
2993#define SUDT_FAST 0x0010
2995#define SUDT_CONST 0x0040
2996#define SUDT_VOLATILE 0x0080
2998#define SUDT_TRUNC 0x0100
2999#define SUDT_SERDEF 0x0200
3005#define DECLARE_TINFO_HELPERS(decl)\
3006decl void ida_export copy_tinfo_t(tinfo_t *_this, const tinfo_t &r); \
3007decl bool ida_export detach_tinfo_t(tinfo_t *_this); \
3008decl void ida_export clear_tinfo_t(tinfo_t *_this);\
3009decl bool ida_export create_tinfo(tinfo_t *_this, type_t bt, type_t bt2, void *ptr);\
3010decl int ida_export verify_tinfo(typid_t typid);\
3011decl bool ida_export get_tinfo_details(typid_t typid, type_t bt2, void *buf);\
3012decl size_t ida_export get_tinfo_size(uint32 *p_effalign, typid_t typid, int gts_code);\
3013decl size_t ida_export get_tinfo_pdata(void *outptr, typid_t typid, int what);\
3014decl size_t ida_export get_tinfo_property(typid_t typid, int gta_prop);\
3015decl size_t ida_export get_tinfo_property4(typid_t typid, int gta_prop, size_t p1, size_t p2, size_t p3, size_t p4);\
3016decl size_t ida_export set_tinfo_property(tinfo_t *tif, int sta_prop, size_t x);\
3017decl size_t ida_export set_tinfo_property4(tinfo_t *tif, int sta_prop, size_t p1, size_t p2, size_t p3, size_t p4);\
3018decl bool ida_export serialize_tinfo(qtype *type, qtype *fields, qtype *fldcmts, const tinfo_t *tif, int sudt_flags);\
3019decl bool ida_export deserialize_tinfo(tinfo_t *tif, const til_t *til, const type_t **ptype, const p_list **pfields, const p_list **pfldcmts, const char *cmt);\
3020decl int ida_export find_tinfo_udt_member(udm_t *udm, typid_t typid, int strmem_flags);\
3021decl bool ida_export print_tinfo(qstring *result, const char *prefix, int indent, int cmtindent, int flags, const tinfo_t *tif, const char *name, const char *cmt);\
3022decl const char *ida_export dstr_tinfo(const tinfo_t *tif);\
3023decl int ida_export visit_subtypes(struct tinfo_visitor_t *visitor, struct type_mods_t *out, const tinfo_t &tif, const char *name, const char *cmt);\
3024decl bool ida_export compare_tinfo(typid_t t1, typid_t t2, int tcflags);\
3025decl int ida_export lexcompare_tinfo(typid_t t1, typid_t t2, int);\
3026decl bool ida_export get_stock_tinfo(tinfo_t *tif, stock_type_id_t id);\
3027decl uint64 ida_export read_tinfo_bitfield_value(typid_t typid, uint64 v, int bitoff);\
3028decl uint64 ida_export write_tinfo_bitfield_value(typid_t typid, uint64 dst, uint64 v, int bitoff);\
3029decl bool ida_export get_tinfo_attr(typid_t typid, const qstring &key, bytevec_t *bv, bool all_attrs);\
3030decl bool ida_export set_tinfo_attr(tinfo_t *tif, const type_attr_t &ta, bool may_overwrite);\
3031decl bool ida_export del_tinfo_attr(tinfo_t *tif, const qstring &key, bool make_copy);\
3032decl bool ida_export get_tinfo_attrs(typid_t typid, type_attrs_t *tav, bool include_ref_attrs);\
3033decl bool ida_export set_tinfo_attrs(tinfo_t *tif, type_attrs_t *ta);\
3034decl uint32 ida_export score_tinfo(const tinfo_t *tif);\
3035decl tinfo_code_t ida_export save_tinfo(tinfo_t *tif, til_t *til, size_t ord, const char *name, int ntf_flags);\
3036decl bool ida_export append_tinfo_covered(rangeset_t *out, typid_t typid, uint64 offset);\
3037decl bool ida_export calc_tinfo_gaps(rangeset_t *out, typid_t typid);\
3038decl bool ida_export name_requires_qualifier(qstring *out, typid_t typid, const char *name, uint64 offset);\
3039decl bool ida_export value_repr_t__from_opinfo(value_repr_t *_this, flags64_t flags, aflags_t afl, const opinfo_t *opinfo, const array_parameters_t *ap); \
3040decl size_t ida_export value_repr_t__print_(const value_repr_t *_this, qstring *result, bool colored); \
3041decl bool ida_export value_repr_t__parse_value_repr(value_repr_t *_this, const qstring &attr, type_t target_type); \
3042decl ssize_t ida_export udt_type_data_t__find_member(const udt_type_data_t *_this, udm_t *udm, int strmem_flags); \
3043decl ssize_t ida_export udt_type_data_t__get_best_fit_member(const udt_type_data_t *_this, asize_t disp); \
3044decl bool ida_export udt_type_data_t__deduplicate_members(udt_type_data_t *_this); \
3045decl bool ida_export udm_t__compare_with(const udm_t *_this, const udm_t &r, int tcflags); \
3046decl uchar ida_export enum_type_data_t__get_max_serial(const enum_type_data_t *ei, uint64 value); \
3047decl tinfo_code_t ida_export enum_type_data_t__set_value_repr(enum_type_data_t *ei, const value_repr_t &repr); \
3048decl tinfo_code_t ida_export enum_type_data_t__get_value_repr(const enum_type_data_t *ei, value_repr_t *repr); \
3049decl void ida_export tinfo_get_innermost_udm(tinfo_t *itif, const tinfo_t *tif, uint64 offset, size_t *udm_idx, uint64 *bit_offset, bool return_member_type); \
3050decl ssize_t ida_export get_udm_by_tid(tinfo_t *tif, udm_t *udm, tid_t tid); \
3051decl ssize_t ida_export get_edm_by_tid(tinfo_t *tif, edm_t *edm, tid_t tid); \
3052decl bool ida_export get_type_by_tid(tinfo_t *tif, tid_t tid); \
3053decl tid_t ida_export get_tinfo_tid(tinfo_t *tif, bool force_tid); \
3054decl ssize_t ida_export get_tinfo_by_edm_name(tinfo_t *tif, const til_t *til, const char *mname); \
3055decl ssize_t ida_export get_frame_var(tinfo_t *tif, sval_t *actval, const insn_t &insn, const op_t *x, sval_t v); \
3056decl bool ida_export tinfo_get_func_frame(tinfo_t *tif, const func_t *pfn); \
3057decl bool ida_export tinfo_get_func_frame_ea(tinfo_t *tif, ea_t func_ea); \
3058decl bool ida_export tinfo_t__build_anon_type_name(qstring *out, const tinfo_t &tif); \
3060DECLARE_TINFO_HELPERS(idaman)
3070const int FIRST_NONTRIVIAL_TYPID = 0x100;
3081 return create_tinfo(
this,
decl_type, bt2, details);
3087 bool get_type_details(
type_t bt2,
void *buf)
const {
return get_tinfo_details(typid, bt2, buf); }
3088 void copy(
const tinfo_t &r) { copy_tinfo_t(
this, r); }
3089 DECLARE_TINFO_HELPERS(
friend)
3090 friend struct type_detail_t;
3121 GTA_LAST_FUNC_ARG = GTA_FUNC_ARG + 255,
3216 parse(decl, til, pt_flags);
3274 bool detach() {
return detach_tinfo_t(
this); }
3279 qtype *fields=
nullptr,
3280 qtype *fldcmts=
nullptr,
3281 int sudt_flags=SUDT_FAST|SUDT_TRUNC)
const
3283 return serialize_tinfo(
type, fields, fldcmts,
this, sudt_flags);
3290 const p_list **pfields=
nullptr,
3291 const p_list **pfldcmts=
nullptr,
3292 const char *cmt=
nullptr)
3294 return deserialize_tinfo(
this, til, ptype, pfields, pfldcmts, cmt);
3300 const qtype *pfields=
nullptr,
3301 const qtype *pfldcmts=
nullptr,
3302 const char *cmt=
nullptr)
3305 const p_list *fp = pfields ==
nullptr ? nullptr : pfields->begin();
3306 const p_list *cp = pfldcmts ==
nullptr ? nullptr : pfldcmts->begin();
3307 const p_list **pfp = fp ==
nullptr ? nullptr : &fp;
3308 const p_list **pcp = cp ==
nullptr ? nullptr : &cp;
3350 size_t get_size(
uint32 *p_effalign=
nullptr,
int gts_code=0)
const {
return get_tinfo_size(p_effalign, typid, gts_code); }
3381 THREAD_SAFE
bool has_details()
const {
return typid >= FIRST_NONTRIVIAL_TYPID; }
3461 bool is_typedef()
const {
return get_tinfo_property(typid, GTA_IS_TYPEDEF) != 0; }
3554 return get_type_details(
BT_PTR, pi);
3560 return get_type_details(
BT_ARRAY, ai);
3566 return get_type_details(
BTF_ENUM, ei);
3578 return get_type_details(
BTF_STRUCT|gtd, udt);
3584 return get_type_details(
BT_FUNC|gtd, fi);
3588 bool is_funcptr()
const {
return get_tinfo_property(typid, GTA_IS_FUNCPTR) != 0; }
3591 bool is_shifted_ptr()
const {
return get_tinfo_property(typid, GTA_IS_SHIFTED_PTR) != 0; }
3594 bool is_varstruct()
const {
return get_tinfo_property(typid, GTA_IS_VARSTRUCT) != 0; }
3599 bool is_varmember()
const {
return get_tinfo_property(typid, GTA_IS_VARMEMBER) != 0; }
3634 if (
n >= -1 &&
n < MAX_FUNC_ARGS )
3635 r.typid = get_tinfo_property(typid, GTA_FUNC_ARG+
n);
3643 int get_nargs()
const {
return int(get_tinfo_property(typid, GTA_FUNC_NARGS)); }
3655 bool is_high_func()
const {
return get_tinfo_property(typid, GTA_IS_HIGH_TYPE) != 0; }
3673 int find_udm(
udm_t *udm,
int strmem_flags)
const {
return find_tinfo_udt_member(udm, typid, strmem_flags); }
3677#define STRMEM_MASK 0x000F
3678#define STRMEM_OFFSET 0x0000
3680#define STRMEM_INDEX 0x0001
3682#define STRMEM_AUTO 0x0002
3685#define STRMEM_NAME 0x0003
3687#define STRMEM_TYPE 0x0004
3690#define STRMEM_SIZE 0x0005
3692#define STRMEM_MINS 0x0006
3693#define STRMEM_MAXS 0x0007
3694#define STRMEM_LOWBND 0x0008
3696#define STRMEM_NEXT 0x0009
3699#define STRMEM_VFTABLE 0x10000000
3702#define STRMEM_SKIP_EMPTY 0x20000000
3706#define STRMEM_CASTABLE_TO 0x40000000
3709#define STRMEM_ANON 0x80000000
3712#define STRMEM_SKIP_GAPS 0x01000000
3723 inline int find_udm(
const char *
name,
int strmem_flags=0)
const;
3750 bool is_small_udt()
const {
return get_tinfo_property(typid, GTA_IS_SMALL_UDT) != 0; }
3790 bool calc_gaps(rangeset_t *out)
const {
return calc_tinfo_gaps(out, typid); }
3796 bool is_sse_type()
const {
return get_tinfo_property(typid, GTA_IS_SSE_TYPE) != 0; }
3806 bool has_vftable()
const {
return get_tinfo_property(typid, GTA_HAS_VFTABLE) != 0; }
3809 bool has_union()
const {
return get_tinfo_property(typid, GTA_HAS_UNION) != 0; }
3866 tid_t get_edm_tid(
size_t idx)
const {
return get_tinfo_property4(typid, GTA_EDM_TID, idx, 0, 0, 0); }
3900 const char *
name=
nullptr,
3901 int prtype_flags=PRTYPE_1LINE,
3904 const char *prefix=
nullptr,
3905 const char *cmt=
nullptr)
const
3907 return print_tinfo(out, prefix, indent, cmtindent, prtype_flags,
this,
name, cmt);
3911 const char *
dstr()
const {
return dstr_tinfo(
this); }
3925 bool set_attr(
const type_attr_t &ta,
bool may_overwrite=
true) {
return set_tinfo_attr(
this, ta, may_overwrite); }
3931 bool del_attr(
const qstring &key,
bool make_copy=
true) {
return del_tinfo_attr(
this, key, make_copy); }
3940 return create_type(
decl_type, bt2, (
void *)&p);
3958 return ::parse_decl(
this,
nullptr, til, decl, pt_flags | PT_SEMICOLON);
4073 return tinfo_code_t(set_tinfo_property4(
this, STA_ALIGNMENT, declalign, 0, 0, etf_flags));
4075#ifndef NO_OBSOLETE_FUNCS
4076 DEPRECATED
bool set_declalign(
uchar declalign) {
return set_tinfo_property(
this, STA_DECLALIGN, declalign) != 0; }
4085 {
return set_tinfo_property(
this, STA_UDT_ALIGN, sudt_flags) != 0; }
4091 return set_tinfo_property(
this, STA_UDT_METHODS,
size_t(&methods)) != 0;
4098 return tinfo_code_t(set_tinfo_property4(
this, STA_COMMENT,
size_t(cmt), is_regcmt, etf_flags, 0));
4105 return uint32(get_tinfo_property(typid, GTA_ALIAS));
4114 return set_tinfo_property4(
this, STA_ALIAS, dest_ord, 0, 0, 0) != 0;
4124 return tinfo_code_t(set_tinfo_property4(
this, STA_SET_SDA, sda, 0, 0, etf_flags));
4136 return tinfo_code_t(set_tinfo_property4(
this, STA_SET_PACK, pack, 0, 0, etf_flags));
4144 tid_t get_udm_tid(
size_t idx)
const {
return get_tinfo_property4(typid, GTA_UDM_TID, idx, 0, 0, 0); }
4157 return tinfo_code_t(set_tinfo_property4(
this, STA_ADD_UDM,
size_t(&udm), times, idx, etf_flags));
4236 return del_udms(index, index+1, etf_flags);
4242 return tinfo_code_t(set_tinfo_property4(
this, STA_DEL_UDMS, idx1, idx2, 0, etf_flags));
4250 return tinfo_code_t(set_tinfo_property4(
this, STA_UDM_NAME, index,
size_t(
name), 0, etf_flags));
4261 return tinfo_code_t(set_tinfo_property4(
this, STA_UDM_TYPE, index,
size_t(&tif),
size_t(repr), etf_flags));
4268 return tinfo_code_t(set_tinfo_property4(
this, STA_UDM_CMT, index,
size_t(cmt), is_regcmt, etf_flags));
4274 return tinfo_code_t(set_tinfo_property4(
this, STA_UDM_REPR, index,
size_t(&repr), 0, etf_flags));
4279 bool is_udm_by_til(
size_t idx)
const {
return get_tinfo_property4(typid, GTA_UDM_IS_BYTIL, idx, 0, 0, 0) != 0; }
4325 return tinfo_code_t(set_tinfo_property4(
this, STA_EXPAND_UDT, idx, delta, 0, etf_flags));
4372 return ::get_frame_var(
this, actval, insn, x, v);
4380 return tinfo_code_t(set_tinfo_property4(
this, STA_ENUM_WIDTH,
nbytes, 0, 0, etf_flags));
4388 return tinfo_code_t(set_tinfo_property4(
this, STA_ENUM_SIGN, sign, 0, 0, etf_flags));
4445 return tinfo_code_t(set_tinfo_property4(
this, STA_ADD_EDM,
size_t(&edm), bmask, idx, etf_flags));
4476 return tinfo_code_t(set_tinfo_property4(
this, STA_DEL_EDMS, idx1, idx2, 0, etf_flags));
4504 return tinfo_code_t(set_tinfo_property4(
this, STA_EDM_NAME, idx,
size_t(
name), 0, etf_flags));
4514 return tinfo_code_t(set_tinfo_property4(
this, STA_EDM_CMT, idx,
size_t(cmt), 0, etf_flags));
4525 return tinfo_code_t(set_tinfo_property4(
this, STA_EDIT_EDM, idx, value, bmask, etf_flags));
4536 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNCARG_NAME, index,
size_t(
name), 0, etf_flags));
4546 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNCARG_TYPE, index,
size_t(&tif), 0, etf_flags));
4555 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNC_RETTYPE,
size_t(&tif), 0, 0, etf_flags));
4565 return tinfo_code_t(set_tinfo_property4(
this, STA_DEL_FUNCARGS, idx1, idx2, 0, etf_flags));
4578 return tinfo_code_t(set_tinfo_property4(
this, STA_ADD_FUNCARG,
size_t(&farg), idx, 0, etf_flags));
4584 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNC_CC, cc, 0, 0, etf_flags));
4594 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNCARG_LOC, index,
size_t(&argloc), 0, etf_flags));
4603 return tinfo_code_t(set_tinfo_property4(
this, STA_FUNC_RETLOC,
size_t(&argloc), 0, 0, etf_flags));
4610 return lexcompare_tinfo(typid, r.typid, 0);
4615#define TCMP_EQUAL 0x0000
4616#define TCMP_IGNMODS 0x0001
4617#define TCMP_AUTOCAST 0x0002
4618#define TCMP_MANCAST 0x0004
4619#define TCMP_CALL 0x0008
4620#define TCMP_DELPTR 0x0010
4621#define TCMP_DECL 0x0020
4622#define TCMP_ANYBASE 0x0040
4623#define TCMP_SKIPTHIS 0x0080
4624#define TCMP_DEEP_UDT 0x0100
4660 if ( pattern ==
nullptr )
4663 || pattern->
name !=
nullptr && !streq(pattern->
name,
name)
4762#define FAI_HIDDEN 0x0001
4763#define FAI_RETPTR 0x0002
4764#define FAI_STRUCT 0x0004
4765#define FAI_ARRAY 0x0008
4768#define FAI_UNUSED 0x0010
4769#define FAI_SWIFTSELF 0x0020
4811 type.parse(_type,
nullptr, PT_SEMICOLON);
4834#define FTI_SPOILED 0x0001
4835#define FTI_NORET 0x0002
4836#define FTI_PURE 0x0004
4837#define FTI_HIGH 0x0008
4838#define FTI_STATIC 0x0010
4839#define FTI_VIRTUAL 0x0020
4840#define FTI_CALLTYPE 0x00C0
4841#define FTI_DEFCALL 0x0000
4842#define FTI_NEARCALL 0x0040
4843#define FTI_FARCALL 0x0080
4844#define FTI_INTCALL 0x00C0
4845#define FTI_ARGLOCS 0x0100
4847#define FTI_EXPLOCS 0x0200
4848#define FTI_CONST 0x0400
4849#define FTI_CTOR 0x0800
4850#define FTI_DTOR 0x1000
4851#define FTI_SYNCHRONIZED 0x2000
4852#define FTI_SWIFTASYNC 0x4000
4856#define FTI_SWIFTTHROWS 0x8000
4861#define FTI_ALL 0xFFFF
4899#define CC_CDECL_OK 0x01
4900#define CC_ALLOW_ARGPERM 0x02
4901#define CC_ALLOW_REGHOLES 0x04
4902#define CC_HAS_ELLIPSIS 0x08
4903#define CC_GOLANG_OK 0x10
4904#define CC_RUST_OK 0x20
4915 if ( from <
size() )
4919 if ( p->name == name )
4970 DEFINE_MEMORY_ALLOCATION_FUNCS()
4993 int get_enum_radix()
const
5034 bool is_hex()
const {
return get_enum_radix() == 16; }
5035 bool is_oct()
const {
return get_enum_radix() == 8; }
5036 bool is_bin()
const {
return get_enum_radix() == 2; }
5078 size_t grp_start = 0;
5081 if ( grp_start + grp_size > idx )
5083 if ( group_start_index !=
nullptr )
5084 *group_start_index = grp_start;
5085 if ( group_size !=
nullptr )
5086 *group_size = grp_size;
5089 grp_start += grp_size;
5105 && grp_start == idx && grp_size > 1;
5120 return sum ==
size();
5128 if ( from <
size() )
5132 if ( p->name == name )
5141 if ( from <
size() )
5143 if ( vmask ==
uint64(-1) )
5146 uint64 value_signed = value | ~vmask;
5149 if ( (p->value == value || p->value == value_signed) && serial-- == 0 )
5182 for (
size_t i=0; i <
index; ++i )
5183 if (
at(i).value == value )
5198 auto gv = [v](
size_t grp_start,
int grp_size)
5200 if ( grp_size == 1 )
5201 return v(grp_start, grp_start, grp_size);
5202 size_t grp_end = grp_start + grp_size;
5203 for (
size_t idx=grp_start+1; idx < grp_end; ++idx )
5205 int code = v(idx, grp_start, grp_size);
5216 for (
size_t idx=0; idx < sz; ++idx )
5218 int code = v(idx, 0,
int(sz));
5227 int for_all_groups(std::function<
int(
size_t grp_start,
int grp_size)> v,
bool skip_trivial=
false)
const
5231 size_t grp_start = 0;
5234 if ( !skip_trivial || grp_size != 1 )
5236 int code = v(grp_start, grp_size);
5240 grp_start += grp_size;
5302#define FRB_FLOAT 0x5
5307#define FRB_OFFSET 0x9
5308#define FRB_STRLIT 0xA
5309#define FRB_STROFF 0xB
5310#define FRB_CUSTOM 0xC
5311#define FRB_INVSIGN 0x0100
5312#define FRB_INVBITS 0x0200
5313#define FRB_SIGNED 0x0400
5314#define FRB_LZERO 0x0800
5315#define FRB_TABFORM 0x1000
5358 ap.flags &= ~AP_SIGNED;
5363 if ( _ap !=
nullptr )
5373 return value_repr_t__from_opinfo(
this, flags, afl, opinfo, _ap);
5377 return value_repr_t__print_(
this,
result, colored);
5381 return value_repr_t__parse_value_repr(
this, attr, target_type);
5453 if (
type.parse(_type,
nullptr, PT_SEMICOLON) )
5500 return udm_t__compare_with(
this, r, tcflags);
5513 return name[0] ==
'_' &&
name[1] ==
'_' &&
type.is_anonymous_udt();
5541 bool is_unaligned()
const {
return (
taudt_bits & TAUDT_UNALIGNED) != 0; }
5581 ssize_t find_member(
udm_t *pattern_udm,
int strmem_flags)
const {
return udt_type_data_t__find_member(
this, pattern_udm, strmem_flags); }
5618#define STRUC_SEPARATOR '.'
5626#define VTBL_SUFFIX "_vtbl"
5633#define VTBL_LAYOUT_SUFFIX "_layout"
5638#define VTBL_MEMNAME "__vftable"
5695 if (
nbytes != r.nbytes )
5696 return nbytes > r.nbytes ? 1 : -1;
5697 if (
width != r.width )
5698 return width > r.width ? 1 : -1;
5701 if ( !r.is_unsigned )
5706 if ( r.is_unsigned )
5753 QASSERT(2858,
is_pow2(type_align));
5754 if ( type_align > slotsize*2 )
5758 type_align = slotsize*2;
5760 return type_align < slotsize
5785inline bool argloc_t::has_reg()
const
5787 if ( !is_scattered() )
5789 for (
const auto &part : scattered() )
5790 if ( part.is_reg() )
5795inline bool argloc_t::has_stkoff()
const
5797 if ( !is_scattered() )
5799 for (
const auto &part : scattered() )
5800 if ( part.is_stkoff() )
5805inline bool argloc_t::in_stack()
const
5807 if ( !is_scattered() )
5809 for (
const auto &part : scattered() )
5810 if ( !part.is_stkoff() )
5815inline bool argloc_t::is_mixed_scattered()
const
5817 if ( !is_scattered() )
5819 bool reg_found =
false;
5820 bool stkoff_found =
false;
5821 for (
const auto &part : scattered() )
5823 if ( part.is_reg() )
5825 if ( part.is_stkoff() )
5826 stkoff_found =
true;
5828 return reg_found && stkoff_found;
5838 if (
name ==
nullptr )
5955 return find_tinfo_udt_member(&udm, typid, STRMEM_OFFSET|strmem_flags);
5962 return find_tinfo_udt_member(&udm, typid, STRMEM_NAME|strmem_flags);
6040 r.typid = get_tinfo_property(tif.typid, tinfo_t::GTA_SAFE_PTR_OBJ);
6054#define TVIS_TYPE 0x0001
6055#define TVIS_NAME 0x0002
6056#define TVIS_CMT 0x0004
6057#define TVIS_RPTCMT 0x0008
6087#define TVST_PRUNE 0x01
6088#define TVST_DEF 0x02
6089#define TVST_LEVEL 0x04
6106 const char *cmt) = 0;
6114 return visit_subtypes(
this, out, tif, name, cmt);
6144#define PIO_NOATTR_FAIL 0x0004
6145#define PIO_IGNORE_PTRS 0x0008
6217 const char *name) = 0;
6283 : tif(_tif), ea(_ea), purged_bytes(_pb) {}
6289 return candidate == tif
6298 return candidate == tif
6323 const char *name=
nullptr,
6389 const char *dotted_path);
6431 ea_t refinfo_ea=BADADDR);
6445 const char *enum_name,
6449 bool convert_to_bitmask,
6450 const char *enum_cmt=
nullptr)
6458 tid_t tid = BADADDR;
6480#define PTV_DEREF 0x0001
6483#define PTV_QUEST 0x0002
6484#define PTV_EMPTY 0x0004
6486#define PTV_CSTR 0x0008
6487#define PTV_EXPAND 0x0010
6490#define PTV_LZERO 0x0020
6491#define PTV_STPFLT 0x0040
6493#define PTV_SPACE 0x0080
6494#define PTV_DEBUG 0x0100
6495#define PTV_NOPTR 0x0200
6496#define PTV_NTOP 0x40000000
6497#define PTV_KEEP 0x80000000
6533 DEFINE_MEMORY_ALLOCATION_FUNCS()
6549#define VALSTR_OPEN 0x01
6553 DEFINE_MEMORY_ALLOCATION_FUNCS()
6555 struct flatten_args_t
6577 bool flatten(
const flatten_args_t &flargs,
int level);
6612 virtual int idaapi
print(
const char *str) = 0;
6633#define PDF_INCL_DEPS 0x01
6634#define PDF_DEF_FWD 0x02
6635#define PDF_DEF_BASE 0x04
6636#define PDF_HEADER_CMT 0x08
6637#define PDF_NO_ANON_NAME 0x10
6671 bool dont_deref_ptr=
false);
6714 const p_list *fields) = 0;
6729 const til_t *root_til,
6773 return a1.compare(a2);
6798 retloc->swap(fti.
retloc);
6845#ifndef NO_OBSOLETE_FUNCS
iterator begin(void)
Get a pointer to the beginning of the qstring.
Definition pro.h:3253
Describes an argument location.
Definition typeinf.hpp:1105
rrel_t * rrel
Definition typeinf.hpp:1115
uint32 reginfo
Definition typeinf.hpp:1114
scattered_aloc_t * dist
Definition typeinf.hpp:1116
void * custom
Definition typeinf.hpp:1117
biggest_t biggest
Definition typeinf.hpp:1118
size_t biggest_t
Definition typeinf.hpp:1107
sval_t sval
Definition typeinf.hpp:1113
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
Register allocation calling convention.
Definition typeinf.hpp:1743
callregs_t(callcnv_t cc)
Constructor - initialize with the given request (see init_regs())
Definition typeinf.hpp:1782
reg_kind_t
Init registers (sequential)
Definition typeinf.hpp:1819
@ FPREGS
Definition typeinf.hpp:1819
@ GPREGS
Definition typeinf.hpp:1819
void swap(callregs_t &r)
swap two instances
Definition typeinf.hpp:1785
argreg_policy_t policy
argument policy
Definition typeinf.hpp:1773
static int findreg(const intvec_t ®s, int r)
Definition typeinf.hpp:1849
bool reginds(int *gp_ind, int *fp_ind, int r) const
Get register indexes within GP/FP arrays.
Definition typeinf.hpp:1857
void reset()
Set policy and registers to invalid values.
Definition typeinf.hpp:1836
void set_registers(reg_kind_t kind, int first_reg, int last_reg)
Definition typeinf.hpp:1828
bool init_regs(callcnv_t cc)
Init policy & registers for given CC.
Definition typeinf.hpp:1794
void set(argreg_policy_t _policy, const int *gprs, const int *fprs)
Init policy & registers (arrays are -1-terminated)
Definition typeinf.hpp:1810
static int regcount(callcnv_t cc)
Get max number of registers may be used in a function call.
Definition typeinf.hpp:1842
intvec_t fpregs
array of fp registers (floating point)
Definition typeinf.hpp:1776
bool findregs(int *gp_ind, int *fp_ind, int r, const intvec_t &gprs, const intvec_t &fprs) const
Search for register r in gprs and fprs.
Definition typeinf.hpp:1865
int nregs
max number of registers that can be used in a call
Definition typeinf.hpp:1774
intvec_t gpregs
array of gp registers (general purpose)
Definition typeinf.hpp:1775
callregs_t()
Constructor.
Definition typeinf.hpp:1779
void append_registers(reg_kind_t kind, int first_reg, int last_reg)
Definition typeinf.hpp:1820
bool by_slots() const
Definition typeinf.hpp:1807
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:106
virtual int idaapi get_func_purged_bytes(const tinfo_t &candidate, const func_type_data_t &) override
Definition typeinf.hpp:6294
virtual bool idaapi func_has_stkframe_hole(const tinfo_t &candidate, const func_type_data_t &candidate_data) override
Definition typeinf.hpp:6285
ida_lowertype_helper_t(const tinfo_t &_tif, ea_t _ea, int _pb)
Definition typeinf.hpp:6282
Class to hold idc values.
Definition expr.hpp:315
Interface class - see ida_lowertype_helper_t.
Definition typeinf.hpp:6260
virtual int idaapi get_func_purged_bytes(const tinfo_t &candidate, const func_type_data_t &candidate_data)=0
virtual bool idaapi func_has_stkframe_hole(const tinfo_t &candidate, const func_type_data_t &candidate_data)=0
virtual ~lowertype_helper_t()
Definition typeinf.hpp:6262
Microcode of one basic block.
Definition hexrays.hpp:4329
Operand of an instruction.
Definition ua.hpp:170
Reimplementation of vector class from STL.
Definition pro.h:2262
void clear(void)
Destroy all elements and free memory.
Definition pro.h:2510
DEFINE_MEMORY_ALLOCATION_FUNCS() void push_back(const argpart_t &x)
Definition pro.h:2420
const int * const_iterator
Definition pro.h:2681
iterator end(void)
Get an iterator that points to the end of the qvector (NOT the last element)
Definition pro.h:2684
void resize(size_t _newsize, const T &x)
Resize to the given size.
Definition pro.h:2540
const edm_t & at(size_t _idx) const
Definition pro.h:2498
iterator find(const T &x)
Find an element in the qvector.
Definition pro.h:2777
qvector(void)
Definition pro.h:2374
edm_t & push_back(void)
Definition pro.h:2473
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2683
void push_back(T &&x)
Append a new element to the end the qvector with a move semantics.
Definition pro.h:2432
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2494
ssize_t index(const edm_t &x) const
Definition pro.h:2797
Used to manage arguments that are described by multiple locations (also see ALOC_DIST)
Definition typeinf.hpp:1347
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
bool remove_ptr_or_array()
Replace the current type with the ptr obj or array element.
Definition typeinf.hpp:4037
tinfo_code_t get_edm(edm_t *edm, size_t idx) const
Get enum member by its index.
Definition typeinf.hpp:3851
type_t get_forward_type() const
Get type of a forward declaration.
Definition typeinf.hpp:3453
THREAD_SAFE bool is_decl_udt() const
is_type_struni(get_decltype())
Definition typeinf.hpp:3484
DECLARE_COMPARISONS(tinfo_t)
Definition typeinf.hpp:4606
THREAD_SAFE bool is_decl_uint128() const
is_type_uint128(get_decltype())
Definition typeinf.hpp:3498
bool is_int64() const
is_type_int64(get_realtype())
Definition typeinf.hpp:3525
THREAD_SAFE bool is_decl_floating() const
is_type_floating(get_decltype())
Definition typeinf.hpp:3503
tinfo_code_t set_udm_by_til(size_t idx, bool on=true, uint etf_flags=0)
The member is created due to the type system.
Definition typeinf.hpp:4285
bool is_scalar() const
Does the type represent a single number?
Definition typeinf.hpp:3549
THREAD_SAFE bool is_decl_tbyte() const
is_type_tbyte(get_decltype())
Definition typeinf.hpp:3502
tinfo_code_t set_udm_repr(size_t index, const value_repr_t &repr, uint etf_flags=0)
Set the representation of a structure/union member.
Definition typeinf.hpp:4272
void create_typedef(const til_t *til, uint ord, type_t decl_type=BTF_TYPEDEF)
Definition typeinf.hpp:3948
bool get_array_details(array_type_data_t *ai) const
Get the array specific info.
Definition typeinf.hpp:3558
bool create_typedef(const typedef_type_data_t &p, type_t decl_type=BTF_TYPEDEF, bool try_ordinal=true)
Definition typeinf.hpp:3937
tinfo_code_t set_enum_radix(int radix, bool sign, uint etf_flags=0)
Set enum radix to display constants.
Definition typeinf.hpp:4425
tinfo_code_t set_enum_width(int nbytes, uint etf_flags=0)
Set the width of enum base type.
Definition typeinf.hpp:4378
tinfo_t get_rettype() const
BT_FUNC or BT_PTR BT_FUNC: Get the function's return type
Definition typeinf.hpp:3640
DEPRECATED bool set_declalign(uchar declalign)
Definition typeinf.hpp:4076
bool is_fixed_struct() const
Is a structure with fixed offsets?
Definition typeinf.hpp:3768
int get_type_cmt(qstring *out) const
Get type comment.
Definition typeinf.hpp:3465
tinfo_code_t set_named_type(til_t *til, const char *name, int ntf_flags=0)
Definition typeinf.hpp:4002
bool get_numbered_type(uint32 ordinal, type_t decl_type=BTF_TYPEDEF, bool resolve=true)
Definition typeinf.hpp:3267
bool has_vftable() const
Has a vftable?
Definition typeinf.hpp:3806
bool set_attrs(type_attrs_t *tav)
Set type attributes.
Definition typeinf.hpp:3922
tinfo_t get_onemember_type() const
For objects consisting of one member entirely: return type of the member.
Definition typeinf.hpp:3869
bool del_attr(const qstring &key, bool make_copy=true)
Del a type attribute. typerefs cannot be modified by this function.
Definition typeinf.hpp:3931
bool get_bit_buckets(range64vec_t *buckets) const
BT_STRUCT: get bit buckets Bit buckets are used to layout bitfields
Definition typeinf.hpp:3664
uint32 get_alignment() const
Get type alignment This function returns the effective type alignment.
Definition typeinf.hpp:3358
tinfo_code_t set_udt_alignment(int sda, uint etf_flags=0)
Set declared structure alignment (sda) This alignment supersedes the alignment returned by get_declal...
Definition typeinf.hpp:4122
tinfo_t get_innermost_member_type(uint64 bitoffset, uint64 *out_bitoffset=nullptr) const
Get the innermost member type at the given offset.
Definition typeinf.hpp:3884
size_t get_enum_nmembers() const
Get number of enum members.
Definition typeinf.hpp:3813
bool get_named_type(const char *name, type_t decl_type=BTF_TYPEDEF, bool resolve=true, bool try_ordinal=true)
Definition typeinf.hpp:3249
THREAD_SAFE bool is_decl_complex() const
is_type_complex(get_decltype())
Definition typeinf.hpp:3479
uint32 get_final_ordinal() const
Get final type ordinal (0 if none)
Definition typeinf.hpp:3436
bool create_udt(bool is_union=false)
Create an empty structure/union.
Definition typeinf.hpp:5854
THREAD_SAFE bool is_decl_uchar() const
is_type_uchar(get_decltype())
Definition typeinf.hpp:3494
tinfo_code_t set_enum_sign(type_sign_t sign, uint etf_flags=0)
Set enum sign.
Definition typeinf.hpp:4386
bool get_type_name(qstring *out) const
Does a type refer to a name?
Definition typeinf.hpp:3388
bool is_one_fpval() const
Floating value or an object consisting of one floating member entirely.
Definition typeinf.hpp:3793
THREAD_SAFE bool is_decl_uint32() const
is_type_uint32(get_decltype())
Definition typeinf.hpp:3496
bool is_ext_arithmetic() const
is_type_ext_arithmetic(get_realtype())
Definition typeinf.hpp:3547
type_sign_t get_sign() const
Get type sign.
Definition typeinf.hpp:3366
bool is_volatile() const
is_type_volatile(get_realtype())
Definition typeinf.hpp:3510
THREAD_SAFE bool is_decl_ldouble() const
is_type_ldouble(get_decltype())
Definition typeinf.hpp:3499
static tinfo_t get_stock(stock_type_id_t id)
Get stock type information.
Definition typeinf.hpp:4026
void set_modifiers(type_t mod)
Definition typeinf.hpp:4057
uint32 get_alias_target() const
Get type alias If the type has no alias, return 0.
Definition typeinf.hpp:4103
bool deserialize(const til_t *til, const type_t **ptype, const p_list **pfields=nullptr, const p_list **pfldcmts=nullptr, const char *cmt=nullptr)
Deserialize a type string into a tinfo_t object.
Definition typeinf.hpp:3287
ssize_t get_udm_by_tid(udm_t *udm, tid_t tid)
Retrive tinfo using type TID or struct/enum member MID.
Definition typeinf.hpp:3984
bool is_ptr_or_array() const
is_type_ptr_or_array(get_realtype())
Definition typeinf.hpp:3542
bool is_vararg_cc() const
is_vararg_cc(get_cc())
Definition typeinf.hpp:3648
tinfo_code_t set_type_alignment(uchar declalign, uint etf_flags=0)
Set type alignment.
Definition typeinf.hpp:4071
bool is_uint() const
is_type_uint(get_realtype())
Definition typeinf.hpp:3530
bool get_enum_details(enum_type_data_t *ei) const
Get the enum specific info.
Definition typeinf.hpp:3564
tinfo_t get_ptrarr_object() const
BT_PTR & BT_ARRAY: get the pointed object or array element.
Definition typeinf.hpp:3606
tinfo_code_t save_type(int ntf_flags=NTF_TYPE|NTF_REPLACE)
Definition typeinf.hpp:4005
bool is_user_cc() const
is_user_cc(get_cc())
Definition typeinf.hpp:3647
til_t * get_til() const
Get the type library for tinfo_t.
Definition typeinf.hpp:3439
uchar get_declalign() const
Get declared alignment of the type.
Definition typeinf.hpp:3375
bool is_tuple() const
Is a tuple?
Definition typeinf.hpp:3771
bool is_varmember() const
Can the type be of a variable struct member?
Definition typeinf.hpp:3599
THREAD_SAFE bool is_decl_union() const
is_type_union(get_decltype())
Definition typeinf.hpp:3483
tinfo_code_t set_func_cc(callcnv_t cc, uint etf_flags=0)
Set function calling convention.
Definition typeinf.hpp:4582
bool get_attrs(type_attrs_t *tav, bool all_attrs=false) const
Get type attributes (all_attrs: include attributes of referenced types, if any)
Definition typeinf.hpp:3914
int get_udt_nmembers() const
Get number of udt members. -1-error.
Definition typeinf.hpp:3744
bool is_float() const
is_type_float(get_realtype())
Definition typeinf.hpp:3538
ssize_t get_edm_by_value(edm_t *out, uint64 value, bmask64_t bmask=DEFMASK64, uchar serial=0) const
Get enum member by its value.
Definition typeinf.hpp:3859
const char * dstr() const
Function to facilitate debugging.
Definition typeinf.hpp:3911
bool get_nice_type_name(qstring *out) const
Get the beautified type name.
Definition typeinf.hpp:3392
bool is_empty_enum() const
Is an empty enum? (has no constants)
Definition typeinf.hpp:3816
ssize_t get_by_edm_name(const char *mname, const til_t *til=nullptr)
Retrieve enum tinfo using enum member name.
Definition typeinf.hpp:3994
bool is_arithmetic() const
is_type_arithmetic(get_realtype())
Definition typeinf.hpp:3546
THREAD_SAFE bool is_decl_char() const
is_type_char(get_decltype())
Definition typeinf.hpp:3492
bool is_floating() const
is_type_floating(get_realtype())
Definition typeinf.hpp:3545
bool clr_const()
Definition typeinf.hpp:4065
tinfo_code_t set_funcarg_type(size_t index, const tinfo_t &tif, uint etf_flags=0)
Set type of a function argument.
Definition typeinf.hpp:4544
THREAD_SAFE bool is_decl_enum() const
is_type_enum(get_decltype())
Definition typeinf.hpp:3485
tid_t get_tid() const
Get the type tid Each type in the local type library has a so-called tid associated with it.
Definition typeinf.hpp:3422
bool is_char() const
is_type_char(get_realtype())
Definition typeinf.hpp:3529
void set_const()
Definition typeinf.hpp:4058
tinfo_t(const tinfo_t &r)
Constructor.
Definition typeinf.hpp:3220
THREAD_SAFE bool is_decl_uint() const
is_type_uint(get_decltype())
Definition typeinf.hpp:3493
bool create_simple_type(type_t decl_type)
Definition typeinf.hpp:3933
tinfo_code_t set_enum_repr(const value_repr_t &repr, uint etf_flags=0)
Set the representation of enum members.
Definition typeinf.hpp:4419
bool is_int128() const
is_type_int128(get_realtype())
Definition typeinf.hpp:3524
bool calc_udt_aligns(int sudt_flags=SUDT_GAPS)
Calculate the udt alignments using the field offsets/sizes and the total udt size This function does ...
Definition typeinf.hpp:4084
bool is_unaligned_struct() const
Is an unaligned struct.
Definition typeinf.hpp:3756
tinfo_code_t rename_funcarg(size_t index, const char *name, uint etf_flags=0)
Rename a function argument.
Definition typeinf.hpp:4534
THREAD_SAFE bool is_decl_unknown() const
is_type_unknown(get_decltype())
Definition typeinf.hpp:3474
THREAD_SAFE bool is_decl_int64() const
is_type_int64(get_decltype())
Definition typeinf.hpp:3488
THREAD_SAFE bool is_decl_int128() const
is_type_int128(get_decltype())
Definition typeinf.hpp:3487
bool is_int16() const
is_type_int16(get_realtype())
Definition typeinf.hpp:3527
bool set_type_alias(uint32 dest_ord)
Set type alias Redirects all references to source type to the destination type.
Definition typeinf.hpp:4112
tinfo_t get_pointed_object() const
BT_PTR: get type of pointed object.
Definition typeinf.hpp:3611
tinfo_code_t del_udms(size_t idx1, size_t idx2, uint etf_flags=0)
Delete structure/union members in the range [idx1, idx2)
Definition typeinf.hpp:4240
bool is_forward_struct() const
Definition typeinf.hpp:3454
bool get_function_frame(ea_t func_ea)
Create a tinfo_t object for the function frame.
Definition typeinf.hpp:4348
const char type_t decl_type
Definition typeinf.hpp:3245
bool is_small_udt() const
Is a small udt? (can fit a register or a pair of registers)
Definition typeinf.hpp:3750
bool is_unsigned() const
Is this an unsigned type?
Definition typeinf.hpp:3372
friend tinfo_t remove_pointer(const tinfo_t &tif)
BT_PTR: If the current type is a pointer, return the pointed object.
Definition typeinf.hpp:6037
bool print(qstring *out, const char *name=nullptr, int prtype_flags=PRTYPE_1LINE, int indent=0, int cmtindent=0, const char *prefix=nullptr, const char *cmt=nullptr) const
Get a C-like string representation of the type.
Definition typeinf.hpp:3898
tinfo_t(type_t decl_type)
Constructor - can only be used to initialize simple types!
Definition typeinf.hpp:3211
tinfo_code_t create_forward_decl(til_t *til, type_t decl_type, const char *name, int ntf_flags=0)
Create a forward declaration.
Definition typeinf.hpp:4011
tinfo_code_t set_numbered_type(til_t *til, uint32 ord, int ntf_flags=0, const char *name=nullptr)
Definition typeinf.hpp:4004
bool is_cpp_struct() const
Is a c++ object, not simple pod type.
Definition typeinf.hpp:3762
bool is_varstruct() const
Is a variable-size structure?
Definition typeinf.hpp:3594
bool is_msstruct() const
Is gcc msstruct attribute applied.
Definition typeinf.hpp:3759
bool deserialize(const til_t *til, const qtype *ptype, const qtype *pfields=nullptr, const qtype *pfldcmts=nullptr, const char *cmt=nullptr)
Deserialize a type string into a tinfo_t object.
Definition typeinf.hpp:3297
uint32 get_ordinal() const
Get type ordinal (only if the type was created as a numbered type, 0 if none)
Definition typeinf.hpp:3433
bool get_udt_details(udt_type_data_t *udt, gtd_udt_t gtd=GTD_CALC_LAYOUT) const
Get the udt specific info.
Definition typeinf.hpp:3576
const char type_t bool bool try_ordinal
Definition typeinf.hpp:3247
THREAD_SAFE bool is_decl_array() const
is_type_array(get_decltype())
Definition typeinf.hpp:3477
tid_t get_udm_tid(size_t idx) const
Get udt member TID.
Definition typeinf.hpp:4144
uint64 write_bitfield_value(uint64 dst, uint64 v, int bitoff) const
Definition typeinf.hpp:4050
bool is_typedef() const
Is this a typedef?
Definition typeinf.hpp:3461
THREAD_SAFE bool empty() const
Was tinfo_t initialized with some type info or not?
Definition typeinf.hpp:3341
bool create_enum(enum_type_data_t &p, type_t decl_type=BTF_ENUM)
Definition typeinf.hpp:3972
tinfo_code_t del_udm(size_t index, uint etf_flags=0)
Delete a structure/union member.
Definition typeinf.hpp:4234
tinfo_code_t del_funcarg(size_t idx, uint etf_flags=0)
Definition typeinf.hpp:4567
bool is_shifted_ptr() const
Is a shifted pointer?
Definition typeinf.hpp:3591
bool get_ptr_details(ptr_type_data_t *pi) const
Get the pointer info.
Definition typeinf.hpp:3552
bool is_sue() const
is_type_sue(get_realtype())
Definition typeinf.hpp:3522
int get_ptrarr_objsize() const
BT_PTR & BT_ARRAY: get size of pointed object or array element. On error returns -1
Definition typeinf.hpp:3602
ssize_t get_stkvar(sval_t *actval, const insn_t &insn, const op_t *x, sval_t v)
Retrieve frame tinfo for a stack variable.
Definition typeinf.hpp:4366
tinfo_code_t set_func_rettype(const tinfo_t &tif, uint etf_flags=0)
Set function return type .
Definition typeinf.hpp:4553
bool clr_volatile()
Definition typeinf.hpp:4066
THREAD_SAFE bool is_decl_void() const
is_type_void(get_decltype())
Definition typeinf.hpp:3472
THREAD_SAFE bool is_decl_uint16() const
is_type_uint16(get_decltype())
Definition typeinf.hpp:3495
uint32 get_udt_taudt_bits() const
Get udt_type_data_t::taudt_bits.
Definition typeinf.hpp:3753
tinfo_code_t set_fixed_struct(bool on=true)
Declare struct member offsets as fixed.
Definition typeinf.hpp:4292
bool is_funcptr() const
Is this pointer to a function?
Definition typeinf.hpp:3588
bool is_forward_enum() const
Definition typeinf.hpp:3456
tinfo_code_t expand_udt(size_t idx, adiff_t delta, uint etf_flags=0)
Expand/shrink a structure by adding/removing a gap before the specified member.
Definition typeinf.hpp:4323
bool is_integral() const
is_type_integral(get_realtype())
Definition typeinf.hpp:3543
type_t get_enum_base_type() const
Get enum base type (convert enum to integer type) Returns BT_UNK if failed to convert.
Definition typeinf.hpp:3820
ssize_t get_edm_by_tid(edm_t *edm, tid_t tid)
Definition typeinf.hpp:3985
THREAD_SAFE bool has_details() const
Does this type refer to a nontrivial type?
Definition typeinf.hpp:3381
THREAD_SAFE bool is_decl_int32() const
is_type_int32(get_decltype())
Definition typeinf.hpp:3489
bool is_high_func() const
BT_FUNC: Is high level type?
Definition typeinf.hpp:3655
THREAD_SAFE bool is_decl_float() const
is_type_float(get_decltype())
Definition typeinf.hpp:3501
bool convert_array_to_ptr()
Convert an array into a pointer.
Definition typeinf.hpp:5904
bool is_bitfield() const
is_type_bitfld(get_realtype())
Definition typeinf.hpp:3523
bool equals_to(const tinfo_t &r) const
Definition typeinf.hpp:4628
THREAD_SAFE bool is_decl_struct() const
is_type_struct(get_decltype())
Definition typeinf.hpp:3482
tinfo_code_t rename_udm(size_t index, const char *name, uint etf_flags=0)
Rename a structure/union member.
Definition typeinf.hpp:4248
tinfo_code_t set_symbol_type(til_t *til, const char *name, int ntf_flags=0)
Definition typeinf.hpp:4003
THREAD_SAFE bool is_decl_sue() const
is_type_sue(get_decltype())
Definition typeinf.hpp:3481
DEPRECATED bool get_func_frame(const func_t *pfn)
Create a tinfo_t object for the function frame.
Definition typeinf.hpp:4344
void create_typedef(const til_t *til, const char *name, type_t decl_type=BTF_TYPEDEF, bool try_ordinal=true)
Definition typeinf.hpp:3947
bool create_func(func_type_data_t &p, type_t decl_type=BT_FUNC)
Definition typeinf.hpp:3973
tinfo_code_t edit_edm(size_t idx, uint64 value, bmask64_t bmask=DEFMASK64, uint etf_flags=0)
Change constant value and/or bitmask.
Definition typeinf.hpp:4523
bool is_uchar() const
is_type_uchar(get_realtype())
Definition typeinf.hpp:3531
tinfo_code_t add_udm(const udm_t &udm, uint etf_flags=0, size_t times=1, ssize_t idx=-1)
Add a structure/union member.
Definition typeinf.hpp:4155
bool create_udt(udt_type_data_t &p, type_t decl_type)
Definition typeinf.hpp:3971
bool change_sign(type_sign_t sign)
Change the type sign. Works only for the types that may have sign.
Definition typeinf.hpp:4080
bool present() const
Is the type really present? (not a reference to a missing type, for example)
Definition typeinf.hpp:3344
tinfo_code_t set_struct_size(size_t new_size)
Explicitly specify the struct size.
Definition typeinf.hpp:4299
tinfo_code_t del_edms(size_t idx1, size_t idx2, uint etf_flags=0)
Delete enum members.
Definition typeinf.hpp:4474
bool is_manually_castable_to(const tinfo_t &target) const
Definition typeinf.hpp:4630
uint64 read_bitfield_value(uint64 v, int bitoff) const
Definition typeinf.hpp:4049
bool has_union() const
Has a member of type "union"?
Definition typeinf.hpp:3809
bool get_numbered_type(const til_t *til, uint32 ordinal, type_t decl_type=BTF_TYPEDEF, bool resolve=true)
Create a tinfo_t object for an existing ordinal type.
Definition typeinf.hpp:5844
THREAD_SAFE bool is_decl_int() const
is_type_int(get_decltype())
Definition typeinf.hpp:3491
bool create_bitfield(const bitfield_type_data_t &p, type_t decl_type=BT_BITFIELD)
Definition typeinf.hpp:3936
int get_array_nelems() const
BT_ARRAY: get number of elements (-1 means error)
Definition typeinf.hpp:3628
bool is_frame() const
Is a function frame?
Definition typeinf.hpp:4351
tinfo_code_t add_edm(const edm_t &edm, bmask64_t bmask=DEFMASK64, uint etf_flags=0, ssize_t idx=-1)
Add a new enum member (a new symbolic constant)
Definition typeinf.hpp:4443
bool append_covered(rangeset_t *out, uint64 offset=0) const
Calculate set of covered bytes for the type.
Definition typeinf.hpp:3786
bool clr_const_volatile()
Definition typeinf.hpp:4067
bool create_enum(bte_t bte=BTE_ALWAYS|BTE_HEX)
Create an empty enum.
Definition typeinf.hpp:5866
const char * name
Definition typeinf.hpp:3244
THREAD_SAFE bool is_well_defined() const
!(empty()) && !(is_decl_partial()) && !(is_punknown())
Definition typeinf.hpp:3506
bool is_udm_by_til(size_t idx) const
Was the member created due to the type system.
Definition typeinf.hpp:4279
size_t get_unpadded_size() const
Get the type size in bytes without the final padding, in bytes.
Definition typeinf.hpp:3354
bool detach()
Detach tinfo_t from the underlying type.
Definition typeinf.hpp:3274
THREAD_SAFE bool is_decl_volatile() const
is_type_volatile(get_decltype())
Definition typeinf.hpp:3471
bool is_enum() const
is_type_enum(get_realtype())
Definition typeinf.hpp:3521
int get_udm(udm_t *out, const char *name) const
Retrieve a structure/union member with the specified name.
Definition typeinf.hpp:5965
tinfo_t get_final_element() const
repeat recursively: if an array, return the type of its element; else return the type itself.
Definition typeinf.hpp:3625
bool is_array() const
is_type_array(get_realtype())
Definition typeinf.hpp:3515
bool is_tbyte() const
is_type_tbyte(get_realtype())
Definition typeinf.hpp:3539
tinfo_code_t copy_type(til_t *til, const char *name, int ntf_flags=NTF_TYPE|NTF_COPY)
Definition typeinf.hpp:4006
bool create_ptr(const ptr_type_data_t &p, type_t decl_type=BT_PTR)
Definition typeinf.hpp:3934
THREAD_SAFE bool is_decl_const() const
is_type_const(get_decltype())
Definition typeinf.hpp:3470
bool is_ext_integral() const
is_type_ext_integral(get_realtype())
Definition typeinf.hpp:3544
bool is_int() const
is_type_int(get_realtype())
Definition typeinf.hpp:3528
bool set_methods(udtmembervec_t &methods)
BT_COMPLEX: set the list of member functions.
Definition typeinf.hpp:4089
bool is_forward_union() const
Definition typeinf.hpp:3455
THREAD_SAFE bool is_decl_func() const
is_type_func(get_decltype())
Definition typeinf.hpp:3478
bool is_uint128() const
is_type_uint128(get_realtype())
Definition typeinf.hpp:3535
THREAD_SAFE bool is_decl_ptr() const
is_type_ptr(get_decltype())
Definition typeinf.hpp:3476
THREAD_SAFE bool is_decl_double() const
is_type_double(get_decltype())
Definition typeinf.hpp:3500
bool calc_gaps(rangeset_t *out) const
Calculate set of padding bytes for the type.
Definition typeinf.hpp:3790
bool get_final_type_name(qstring *out) const
Use in the case of typedef chain (TYPE1 -> TYPE2 -> TYPE3...TYPEn).
Definition typeinf.hpp:3406
bool is_from_subtil() const
Was the named type found in some base type library (not the top level type library)?
Definition typeinf.hpp:3444
tid_t force_tid()
Get the type tid.
Definition typeinf.hpp:3430
THREAD_SAFE bool is_decl_last() const
is_typeid_last(get_decltype())
Definition typeinf.hpp:3475
bool create_array(const array_type_data_t &p, type_t decl_type=BT_ARRAY)
Definition typeinf.hpp:3935
bool is_correct() const
Is the type object correct?
Definition typeinf.hpp:3318
tinfo_t()
Constructor.
Definition typeinf.hpp:3209
bool is_forward_decl() const
Is this a forward declaration?
Definition typeinf.hpp:3448
bool is_int32() const
is_type_int32(get_realtype())
Definition typeinf.hpp:3526
bool is_bitmask_enum() const
Is bitmask enum?
Definition typeinf.hpp:3825
tinfo_code_t del_funcargs(size_t idx1, size_t idx2, uint etf_flags=0)
Delete function arguments.
Definition typeinf.hpp:4563
void del_attrs()
Del all type attributes. typerefs cannot be modified by this function.
Definition typeinf.hpp:3928
tinfo_t & operator=(const tinfo_t &r)
Copy contents of given tinfo into this one.
Definition typeinf.hpp:3222
bool is_bool() const
is_type_bool(get_realtype())
Definition typeinf.hpp:3540
tinfo_t(const char *decl, til_t *til=nullptr, int pt_flags=0)
Constructor - will attempt to parse the provided C declaration.
Definition typeinf.hpp:3213
bool is_aliased() const
Definition typeinf.hpp:4107
ea_t get_frame_func() const
Get function address for the frame.
Definition typeinf.hpp:4354
bool is_anonymous_type_name() const
Is an anonymous type?
Definition typeinf.hpp:3803
bool is_empty_udt() const
Is an empty struct/union? (has no fields)
Definition typeinf.hpp:3747
tinfo_code_t set_enum_is_bitmask(bitmask_cvt_stance_t stance=ENUMBM_ON, uint etf_flags=0)
Definition typeinf.hpp:4414
int get_nargs() const
BT_FUNC or BT_PTR BT_FUNC: Calculate number of arguments (-1 - error)
Definition typeinf.hpp:3643
tinfo_code_t set_udm_cmt(size_t index, const char *cmt, bool is_regcmt=false, uint etf_flags=0)
Set a comment for a structure/union member.
Definition typeinf.hpp:4266
bool is_anonymous_udt() const
Is an anonymous struct/union?
Definition typeinf.hpp:3800
tinfo_t get_innermost_udm(uint64 bitoffset, size_t *out_index=nullptr, uint64 *out_bitoffset=nullptr) const
Get the innermost member at the given offset.
Definition typeinf.hpp:3877
bitmask_cvt_stance_t
Set or clear the 'bitmask' attribute of an enum.
Definition typeinf.hpp:4409
@ ENUMBM_ON
convert to bitmask enum
Definition typeinf.hpp:4411
@ ENUMBM_OFF
convert to ordinal enum
Definition typeinf.hpp:4410
@ ENUMBM_AUTO
convert to bitmask if the outcome is nice and useful
Definition typeinf.hpp:4412
type_t get_modifiers() const
Definition typeinf.hpp:4056
tinfo_code_t add_funcarg(const funcarg_t &farg, uint etf_flags=0, ssize_t idx=-1)
Add a function argument.
Definition typeinf.hpp:4576
type_t get_realtype(bool full=false) const
Get the resolved base type.
Definition typeinf.hpp:3331
tinfo_code_t set_func_retloc(const argloc_t &argloc, uint etf_flags=0)
Set location of function return value.
Definition typeinf.hpp:4601
tinfo_code_t set_type_cmt(const char *cmt, bool is_regcmt=false, uint etf_flags=0)
Set type comment This function works only for non-trivial types.
Definition typeinf.hpp:4096
int calc_purged_bytes() const
BT_FUNC: Calculate number of purged bytes
Definition typeinf.hpp:3652
void set_volatile()
Definition typeinf.hpp:4059
bool is_iface() const
Is an interface?
Definition typeinf.hpp:3774
void swap(tinfo_t &r)
Assign this = r and r = this.
Definition typeinf.hpp:3228
void clear()
Clear contents of this tinfo, and remove from the type system.
Definition typeinf.hpp:3226
bool is_partial() const
is_type_partial(get_realtype())
Definition typeinf.hpp:3512
bool get_methods(udtmembervec_t *methods) const
BT_COMPLEX: get a list of member functions declared in this udt.
Definition typeinf.hpp:3659
bool is_pvoid() const
Is "void *"?
Definition typeinf.hpp:3615
int get_udm_by_offset(udm_t *out, uint64 offset) const
Retrieve a structure/union member with the specified offset.
Definition typeinf.hpp:5986
bool is_ldouble() const
is_type_ldouble(get_realtype())
Definition typeinf.hpp:3536
bool parse(const char *decl, til_t *til=nullptr, int pt_flags=0)
Convenience function to parse a string with a type declaration.
Definition typeinf.hpp:3956
bool get_attr(const qstring &key, bytevec_t *bv, bool all_attrs=true) const
Get a type attribute.
Definition typeinf.hpp:3917
uint32 calc_score() const
Calculate the type score (the higher - the nicer is the type)
Definition typeinf.hpp:3887
tinfo_t get_array_element() const
BT_ARRAY: get type of array element. See also get_ptrarr_object()
Definition typeinf.hpp:3622
bool build_anon_type_name(qstring *out) const
Generate a name like $hex_numbers based on the field types and names.
Definition typeinf.hpp:3395
bool is_const() const
is_type_const(get_realtype())
Definition typeinf.hpp:3509
int get_enum_width() const
Get enum width.
Definition typeinf.hpp:3839
bool serialize(qtype *type, qtype *fields=nullptr, qtype *fldcmts=nullptr, int sudt_flags=SUDT_FAST|SUDT_TRUNC) const
Serialize tinfo_t object into a type string.
Definition typeinf.hpp:3277
tinfo_code_t rename_type(const char *name, int ntf_flags=0)
Rename a type.
Definition typeinf.hpp:3401
DEFINE_MEMORY_ALLOCATION_FUNCS() inline bool get_named_type(const til_t *til
Create a tinfo_t object for an existing named type.
bool is_sse_type() const
Is a SSE vector type?
Definition typeinf.hpp:3796
THREAD_SAFE bool is_decl_uint64() const
is_type_uint64(get_decltype())
Definition typeinf.hpp:3497
bool is_double() const
is_type_double(get_realtype())
Definition typeinf.hpp:3537
bool is_func() const
is_type_func(get_realtype())
Definition typeinf.hpp:3516
bool get_next_type_name(qstring *out) const
Use In the case of typedef chain (TYPE1 -> TYPE2 -> TYPE3...TYPEn).
Definition typeinf.hpp:3411
bool is_uint64() const
is_type_uint64(get_realtype())
Definition typeinf.hpp:3534
bool is_ptr() const
is_type_ptr(get_realtype())
Definition typeinf.hpp:3514
bool get_type_by_tid(tid_t tid)
Definition typeinf.hpp:3986
bool requires_qualifier(qstring *out, const char *name, uint64 offset) const
Requires full qualifier?
Definition typeinf.hpp:3781
int find_udm(udm_t *udm, int strmem_flags) const
BTF_STRUCT,BTF_UNION: Find a udt member.
Definition typeinf.hpp:3673
bool get_bitfield_details(bitfield_type_data_t *bi) const
Get the bitfield specific info.
Definition typeinf.hpp:3570
tinfo_code_t set_iface(bool on=true)
Declare struct as an interface.
Definition typeinf.hpp:4339
tinfo_code_t get_enum_repr(value_repr_t *repr) const
Set the representation of enum members.
Definition typeinf.hpp:3834
ssize_t get_edm(edm_t *out, const char *name) const
Get enum member by its name.
Definition typeinf.hpp:3846
bool set_attr(const type_attr_t &ta, bool may_overwrite=true)
Set a type attribute. If necessary, a new typid will be created.
Definition typeinf.hpp:3925
bool is_struct() const
is_type_struct(get_realtype())
Definition typeinf.hpp:3518
size_t get_size(uint32 *p_effalign=nullptr, int gts_code=0) const
Get the type size in bytes.
Definition typeinf.hpp:3350
bool is_purging_cc() const
is_purging_cc(get_cc())
Definition typeinf.hpp:3649
THREAD_SAFE bool is_decl_paf() const
is_type_paf(get_decltype())
Definition typeinf.hpp:3505
bool is_complex() const
is_type_complex(get_realtype())
Definition typeinf.hpp:3517
tinfo_code_t set_edm_cmt(size_t idx, const char *cmt, uint etf_flags=0)
Set a comment for an enum member.
Definition typeinf.hpp:4512
bool get_type_rptcmt(qstring *out) const
Get type comment only if it is repeatable.
Definition typeinf.hpp:3468
bool get_func_details(func_type_data_t *fi, gtd_func_t gtd=GTD_CALC_ARGLOCS) const
Get only the function specific info for this tinfo_t.
Definition typeinf.hpp:3582
tinfo_code_t del_edm_by_value(uint64 value, uint etf_flags=0, bmask64_t bmask=DEFMASK64, uchar serial=0)
Delete enum member by its value.
Definition typeinf.hpp:6015
bool is_paf() const
is_type_paf(get_realtype())
Definition typeinf.hpp:3541
bool is_punknown() const
Is "_UNKNOWN *"?
Definition typeinf.hpp:3619
THREAD_SAFE bool is_decl_bitfield() const
is_type_bitfld(get_decltype())
Definition typeinf.hpp:3486
tinfo_code_t set_tuple(bool on=true)
Declare struct as a tuple.
Definition typeinf.hpp:4334
bool is_signed() const
Is this a signed type?
Definition typeinf.hpp:3369
THREAD_SAFE bool is_decl_int16() const
is_type_int16(get_decltype())
Definition typeinf.hpp:3490
tid_t get_edm_tid(size_t idx) const
Get enum member TID.
Definition typeinf.hpp:3866
tinfo_code_t rename_edm(size_t idx, const char *name, uint etf_flags=0)
Rename a enum member.
Definition typeinf.hpp:4502
tinfo_code_t set_udm_type(size_t index, const tinfo_t &tif, uint etf_flags=0, const value_repr_t *repr=nullptr)
Set type of a structure/union member.
Definition typeinf.hpp:4259
tinfo_code_t del_edm(size_t idx, uint etf_flags=0)
Definition typeinf.hpp:4478
THREAD_SAFE bool is_decl_partial() const
is_type_partial(get_decltype())
Definition typeinf.hpp:3473
bool is_uint32() const
is_type_uint32(get_realtype())
Definition typeinf.hpp:3533
bool is_unknown() const
is_type_unknown(get_realtype())
Definition typeinf.hpp:3513
THREAD_SAFE bool is_decl_bool() const
is_type_bool(get_decltype())
Definition typeinf.hpp:3504
const char type_t bool resolve
Definition typeinf.hpp:3246
int get_enum_radix() const
Get enum constant radix.
Definition typeinf.hpp:3830
THREAD_SAFE bool is_decl_typedef() const
is_type_typedef(get_decltype())
Definition typeinf.hpp:3480
bool is_union() const
is_type_union(get_realtype())
Definition typeinf.hpp:3519
tinfo_code_t set_funcarg_loc(size_t index, const argloc_t &argloc, uint etf_flags=0)
Set location of a function argument.
Definition typeinf.hpp:4592
THREAD_SAFE type_t get_decltype() const
Get declared type (without resolving type references; they are returned as is).
Definition typeinf.hpp:3338
bool is_vftable() const
Is a vftable type?
Definition typeinf.hpp:3765
bool compare_with(const tinfo_t &r, int tcflags=0) const
Compare two types, based on given flags (see tinfo_t comparison flags)
Definition typeinf.hpp:4627
void clr_decl_const_volatile()
Definition typeinf.hpp:4061
~tinfo_t()
Destructor.
Definition typeinf.hpp:3224
callcnv_t get_cc() const
BT_FUNC or BT_PTR BT_FUNC: Get calling convention
Definition typeinf.hpp:3646
bool is_castable_to(const tinfo_t &target) const
Definition typeinf.hpp:4629
bool is_udt() const
is_type_struni(get_realtype())
Definition typeinf.hpp:3520
bool is_void() const
is_type_void(get_realtype())
Definition typeinf.hpp:3511
tinfo_t get_nth_arg(int n) const
BT_FUNC or BT_PTR BT_FUNC: Get type of n-th arg (-1 means return type, see get_rettype())
Definition typeinf.hpp:3631
THREAD_SAFE bool is_typeref() const
Is this type a type reference?
Definition typeinf.hpp:3378
tinfo_code_t set_udt_pack(int pack, uint etf_flags=0)
Set structure packing.
Definition typeinf.hpp:4134
bool is_uint16() const
is_type_uint16(get_realtype())
Definition typeinf.hpp:3532
uint64 calc_enum_mask() const
Definition typeinf.hpp:3840
Text representation of a data value (value string).
Definition typeinf.hpp:6542
qstring oneline
result if printed on one line in UTF-8 encoding
Definition typeinf.hpp:6544
bool append_char(char c, int max_length)
bool flatten(const flatten_args_t &flargs, int level)
void set_oneline(const char *line, int len)
Definition typeinf.hpp:6565
bool convert_to_one_line(int ptvf, int max_length)
~valstr_t()
Definition typeinf.hpp:6584
struct valstrs_t * members
strings for members, each member separately
Definition typeinf.hpp:6546
void consume_oneline(const qstring &line)
Definition typeinf.hpp:6570
void update_length(int ptvf)
int props
temporary properties, used internally
Definition typeinf.hpp:6548
valinfo_t * info
additional info
Definition typeinf.hpp:6547
valstr_t()
Definition typeinf.hpp:6551
friend struct() private valstr_sink_t
Definition typeinf.hpp:6553
size_t length
length if printed on one line
Definition typeinf.hpp:6545
idaman callcnv_t ida_export find_custom_callcnv(const char *name)
Find a calling convention by its name.
idaman size_t ida_export get_custom_callcnvs(qstrvec_t *names, callcnvs_t *codes)
Get all custom calling conventions.
argreg_policy_t
Function argument passing: how GP & FP registers cooperate with each other.
Definition typeinf.hpp:1724
idaman int ida_export verify_argloc(const argloc_t &vloc, int size, const rangeset_t *gaps)
Verify argloc_t.
constexpr THREAD_SAFE bool is_purging_cc(callcnv_t cc)
Does the calling convention clean the stack arguments upon return?
Definition typeinf.hpp:1478
void helper_set_cc(cm_t *cm, callcnv_t *new_callcnv, callcnv_t cc)
Definition typeinf.hpp:1436
constexpr THREAD_SAFE bool is_vararg_cc(callcnv_t cc)
Does the calling convention use ellipsis?
Definition typeinf.hpp:1470
idaman const custom_callcnv_t *ida_export get_custom_callcnv(callcnv_t callcnv)
Retrieve custom calling convention details.
constexpr bool is_rust_cc(callcnv_t cc)
Rust language calling convention?
Definition typeinf.hpp:1496
idaman int ida_export install_custom_argloc(const custloc_desc_t *custloc)
Save a custom argloc.
int idaapi for_all_const_arglocs(const_aloc_visitor_t &vv, const argloc_t &vloc, int size, int off=0)
See for_all_arglocs()
Definition typeinf.hpp:1403
const argloc_type_t ALOC_NONE
none
Definition typeinf.hpp:957
callcnv_t helper_get_cc(cm_t cm, callcnv_t new_callcnv)
Definition typeinf.hpp:1427
qvector< argpart_t > argpartvec_t
Definition typeinf.hpp:1343
const argloc_type_t ALOC_CUSTOM
custom argloc (7 or higher)
Definition typeinf.hpp:964
const argloc_type_t ALOC_RREL
register relative
Definition typeinf.hpp:962
const argloc_type_t ALOC_DIST
distributed (scattered)
Definition typeinf.hpp:959
const argloc_type_t ALOC_REG2
register pair
Definition typeinf.hpp:961
idaman bool ida_export unregister_custom_callcnv(callcnv_t callcnv)
Unregister a calling convention.
const argloc_type_t ALOC_STATIC
global address
Definition typeinf.hpp:963
idaman bool ida_export get_stkarg_area_info(stkarg_area_info_t *out, callcnv_t cc)
Some calling conventions foresee special areas on the stack for call arguments.
const argloc_type_t ALOC_REG1
one register (and offset within it)
Definition typeinf.hpp:960
idaman const custloc_desc_t *ida_export retrieve_custom_argloc(int idx)
Retrieve the custom argloc at the given index.
constexpr THREAD_SAFE bool is_user_cc(callcnv_t cc)
Does the calling convention specify argument locations explicitly?
Definition typeinf.hpp:1464
idaman size_t ida_export print_argloc(char *buf, size_t bufsize, const argloc_t &vloc, int size=0, int vflags=0)
Convert an argloc to human readable form.
constexpr bool is_swift_cc(callcnv_t cc)
Swift calling convention (arguments and return values in registers)?
Definition typeinf.hpp:1513
idaman int ida_export for_all_arglocs(aloc_visitor_t &vv, argloc_t &vloc, int size, int off=0)
Compress larger argloc types and initiate the aloc visitor.
constexpr bool is_golang_cc(callcnv_t cc)
GO language calling convention (return value in stack)?
Definition typeinf.hpp:1490
void set_cc(callcnv_t cc)
Definition typeinf.hpp:1452
qvector< argloc_t > arglocs_t
vector of argument locations
Definition typeinf.hpp:1313
idaman callcnv_t ida_export register_custom_callcnv(const custom_callcnv_t &ccinf)
Register a calling convention.
idaman bool ida_export optimize_argloc(argloc_t *vloc, int size, const rangeset_t *gaps)
Verify and optimize scattered argloc into simple form.
idaman bool ida_export remove_custom_argloc(int idx)
Delete the custom argloc at the given index.
const argloc_type_t ALOC_STACK
stack offset
Definition typeinf.hpp:958
callcnv_t get_cc() const
Definition typeinf.hpp:1451
bool is_custom_callcnv(callcnv_t cc)
Is custom calling convention?
Definition typeinf.hpp:1502
callcnv_t get_effective_cc(callcnv_t cc)
Get effective calling convention (with respect to default CC)
Definition typeinf.hpp:1455
@ ARGREGS_GP_ONLY
GP registers used for all arguments.
Definition typeinf.hpp:1726
@ ARGREGS_POLICY_UNDEFINED
Definition typeinf.hpp:1725
@ ARGREGS_RISCV
Risc-V API FP arguments are passed in GP registers if FP registers are exhausted and GP ones are not.
Definition typeinf.hpp:1731
@ ARGREGS_FP_MASKS_GP
FP register also consumes one or more GP regs but not vice versa (aix ppc ABI)
Definition typeinf.hpp:1729
@ ARGREGS_BY_SLOTS
fixed FP/GP register per each slot (like vc64)
Definition typeinf.hpp:1728
@ ARGREGS_MIPS_O32
MIPS ABI o32.
Definition typeinf.hpp:1730
@ ARGREGS_INDEPENDENT
FP/GP registers used separately (like gcc64)
Definition typeinf.hpp:1727
const type_t BFA_STATIC
static
Definition typeinf.hpp:929
const type_t BFA_FUNC_EXT_FORMAT
This is NOT a real attribute (used internally as marker for extended format)
Definition typeinf.hpp:933
const type_t BFA_NORET
__noreturn
Definition typeinf.hpp:926
const cm_t BFA_FUNC_MARKER
This is NOT a cc! (used internally as a marker)
Definition typeinf.hpp:932
const type_t BFA_VIRTUAL
virtual
Definition typeinf.hpp:930
const type_t BFA_HIGH
high level prototype (with possibly hidden args)
Definition typeinf.hpp:928
const type_t BFA_PURE
__pure
Definition typeinf.hpp:927
const cm_t C_PC_FLAT
Definition typeinf.hpp:1421
const cm_t C_PC_SMALL
Definition typeinf.hpp:1416
const cm_t C_PC_MEDIUM
Definition typeinf.hpp:1418
const cm_t C_PC_LARGE
Definition typeinf.hpp:1419
const cm_t C_PC_TINY
Definition typeinf.hpp:1415
const cm_t C_PC_HUGE
Definition typeinf.hpp:1420
const cm_t C_PC_COMPACT
Definition typeinf.hpp:1417
bool is_gcc()
Is the target compiler COMP_GNU?
Definition typeinf.hpp:1933
bool idaapi set_abi_name(const char *abiname, bool user_level=false)
Set abi name (see Compiler IDs)
Definition typeinf.hpp:1984
idaman void ida_export get_compilers(compvec_t *ids, qstrvec_t *names, qstrvec_t *abbrs)
Get names of all built-in compilers.
idaman bool ida_export set_compiler_string(const char *compstr, bool user_level)
bool use_golang_cc()
is GOLANG calling convention used by default?
Definition typeinf.hpp:2013
THREAD_SAFE comp_t get_comp(comp_t comp)
Get compiler bits.
Definition typeinf.hpp:1900
bool is_gcc32()
Is the target compiler 32 bit gcc?
Definition typeinf.hpp:1938
bool use_rust_cc()
is RUST calling convention used by default?
Definition typeinf.hpp:2029
idaman bool ida_export set_compiler(const compiler_info_t &cc, int flags, const char *abiname=nullptr)
Change current compiler.
bool gcc_layout()
Should use the struct/union layout as done by gcc?
Definition typeinf.hpp:1948
idaman ssize_t ida_export get_abi_name(qstring *out)
Get ABI name.
comp_t default_compiler()
Get compiler specified by inf.cc.
Definition typeinf.hpp:1928
idaman bool ida_export remove_abi_opts(const char *abi_opts, bool user_level=false)
THREAD_SAFE comp_t is_comp_unsure(comp_t comp)
See COMP_UNSURE.
Definition typeinf.hpp:1923
idaman const char *ida_export get_compiler_name(comp_t id)
Get full compiler name.
qvector< comp_t > compvec_t
Collection of compiler descriptions.
Definition typeinf.hpp:1913
idaman bool ida_export append_abi_opts(const char *abi_opts, bool user_level=false)
Add/remove/check ABI option General form of full abi name: abiname-opt1-opt2-... or -opt1-opt2-....
void switch_to_golang()
switch to GOLANG calling convention (to be used as default CC)
Definition typeinf.hpp:2020
idaman void ida_export switch_to_rust()
switch to RUST calling convention (to be used as default CC)
bool idaapi set_compiler_id(comp_t id, const char *abiname=nullptr)
Set the compiler id (see Compiler IDs)
Definition typeinf.hpp:1975
bool is_gcc64()
Is the target compiler 64 bit gcc?
Definition typeinf.hpp:1943
idaman const char *ida_export get_compiler_abbr(comp_t id)
Get abbreviated compiler name.
const callcnv_t CM_CC_PASCAL
stack, purged, reverse order of args
Definition typeinf.hpp:889
const callcnv_t CM_CC_SWIFT
(Swift) arguments and return values in registers (compiler-dependent)
Definition typeinf.hpp:892
const callcnv_t CM_CC_RESERVE3
reserved; used for internal needs
Definition typeinf.hpp:898
const callcnv_t CM_CC_CDECL
stack
Definition typeinf.hpp:886
const callcnv_t CM_CC_INVALID
this value is invalid
Definition typeinf.hpp:881
const callcnv_t CM_CC_SPECIALP
Equal to CM_CC_SPECIAL, but with purged stack.
Definition typeinf.hpp:900
const callcnv_t CM_CC_RUST
(Rust) arguments and return value follow the Rust ABI
Definition typeinf.hpp:906
const callcnv_t CM_CC_GOLANG
(Go) arguments and return value reg/stack depending on version
Definition typeinf.hpp:897
const callcnv_t CM_CC_FASTCALL
stack, purged (x86), first args are in regs (compiler-dependent)
Definition typeinf.hpp:890
const callcnv_t CM_CC_STDCALL
stack, purged
Definition typeinf.hpp:888
const callcnv_t CM_CC_SPECIAL
usercall: locations of all arguments and the return value are explicitly specified
Definition typeinf.hpp:901
const callcnv_t CM_CC_THISCALL
stack, purged (x86), first arg is in reg (compiler-dependent)
Definition typeinf.hpp:891
const callcnv_t CM_CC_VOIDARG
function without arguments if has other cc and argnum == 0, represent as f() - unknown list
Definition typeinf.hpp:883
const callcnv_t CM_CC_GOSTK
(Go) arguments and return value in stack
Definition typeinf.hpp:905
const callcnv_t CM_CC_SPOILED
This is NOT a cc!
Definition typeinf.hpp:893
const callcnv_t CM_CC_MASK
Definition typeinf.hpp:880
const callcnv_t CM_CC_LAST_USERCALL
Definition typeinf.hpp:903
const callcnv_t CM_CC_UNKNOWN
unknown calling convention
Definition typeinf.hpp:882
const callcnv_t CM_CC_FIRST_PLAIN_CUSTOM
Definition typeinf.hpp:908
const callcnv_t CM_CC_ELLIPSIS
cdecl + ellipsis
Definition typeinf.hpp:887
const callcnv_t CM_CC_SPECIALE
CM_CC_SPECIAL with ellipsis
Definition typeinf.hpp:899
const cm_t CM_M_MASK
Definition typeinf.hpp:866
THREAD_SAFE bool is_code_far(cm_t cm)
Does the given model specify far code?
Definition typeinf.hpp:873
THREAD_SAFE bool is_data_far(cm_t cm)
Does the given model specify far data?
Definition typeinf.hpp:875
const cm_t CM_M_NN
small: code=near, data=near (or unknown if CM_UNKNOWN)
Definition typeinf.hpp:867
const cm_t CM_M_FN
medium: code=far, data=near
Definition typeinf.hpp:870
const cm_t CM_M_FF
large: code=far, data=far
Definition typeinf.hpp:868
const cm_t CM_M_NF
compact: code=near, data=far
Definition typeinf.hpp:869
const cm_t CM_N32_F48
near 4 bytes, far 6 bytes
Definition typeinf.hpp:862
const cm_t CM_N16_F32
near 2 bytes, far 4 bytes
Definition typeinf.hpp:861
const cm_t CM_UNKNOWN
unknown
Definition typeinf.hpp:858
const cm_t CM_N8_F16
if sizeof(int)<=2: near 1 byte, far 2 bytes
Definition typeinf.hpp:859
const cm_t CM_MASK
Definition typeinf.hpp:857
const cm_t CM_N64
if sizeof(int)>2: near 8 bytes, far 8 bytes
Definition typeinf.hpp:860
const comp_t COMP_BP
Delphi.
Definition typeinf.hpp:1889
const comp_t COMP_WATCOM
Watcom C++.
Definition typeinf.hpp:1884
const comp_t COMP_MASK
Definition typeinf.hpp:1880
const comp_t COMP_UNK
Unknown.
Definition typeinf.hpp:1881
const comp_t COMP_BC
Borland C++.
Definition typeinf.hpp:1883
const comp_t COMP_GNU
GNU C++.
Definition typeinf.hpp:1887
const comp_t COMP_MS
Visual C++.
Definition typeinf.hpp:1882
const comp_t COMP_UNSURE
uncertain compiler id
Definition typeinf.hpp:1891
const comp_t COMP_VISAGE
Visual Age C++.
Definition typeinf.hpp:1888
etf_flag_t
Definition typeinf.hpp:2940
@ ETF_NO_LAYOUT
don't calc type layout before editing
Definition typeinf.hpp:2945
@ ETF_FUNCARG
udm - member is a function argument (cannot create arrays)
Definition typeinf.hpp:2948
@ ETF_AUTONAME
udm - generate a member name if was not specified (add_udm, set_udm_type)
Definition typeinf.hpp:2950
@ ETF_NO_ARRAY
add_udm, set_udm_type - do not convert type to an array on the size mismatch
Definition typeinf.hpp:2952
@ ETF_FORCENAME
anyway use name, see below for more usage description
Definition typeinf.hpp:2949
@ ETF_NO_SAVE
don't save to til (normally typerefs are saved to til) A call with ETF_NO_SAVE must be followed by a ...
Definition typeinf.hpp:2941
@ ETF_COMPATIBLE
new type must be compatible with the old
Definition typeinf.hpp:2947
@ ETF_MAY_DESTROY
may destroy other members
Definition typeinf.hpp:2946
@ ETF_BYTIL
udm - new type was created by the type subsystem
Definition typeinf.hpp:2951
idaman bool ida_export decorate_name(qstring *out, const char *name, bool should_decorate, callcnv_t cc=CM_CC_UNKNOWN, const tinfo_t *type=nullptr)
Decorate/undecorate a C symbol name.
idaman ssize_t ida_export calc_c_cpp_name(qstring *out, const char *name, const tinfo_t *type, int ccn_flags)
Get C or C++ form of the name.
idaman bool ida_export del_named_type(til_t *ti, const char *name, int ntf_flags)
Delete information about a symbol.
idaman const char *ida_export next_named_type(const til_t *ti, const char *name, int ntf_flags)
Enumerate types.
idaman bool ida_export gen_decorate_name(qstring *out, const char *name, bool should_decorate, callcnv_t cc, const tinfo_t *type)
Generic function for decorate_name() (may be used in IDP modules)
idaman const char *ida_export first_named_type(const til_t *ti, int ntf_flags)
Enumerate types.
tinfo_code_t
Error codes various tinfo functions:
Definition typeinf.hpp:2352
virtual bool decorate_name(qstring *outbuf, const char *name, bool should_decorate, callcnv_t cc, const tinfo_t &type) const
Decorate a function name.
Definition typeinf.hpp:2464
idaman const char *ida_export tinfo_errstr(tinfo_code_t code)
Helper function to convert an error code into a printable string.
int idaapi get_named_type64(const til_t *ti, const char *name, int ntf_flags, const type_t **type=nullptr, const p_list **fields=nullptr, const char **cmt=nullptr, const p_list **fieldcmts=nullptr, sclass_t *sclass=nullptr, uint64 *value=nullptr)
See get_named_type() above.
Definition typeinf.hpp:2334
idaman int ida_export get_named_type(const til_t *ti, const char *name, int ntf_flags, const type_t **type=nullptr, const p_list **fields=nullptr, const char **cmt=nullptr, const p_list **fieldcmts=nullptr, sclass_t *sclass=nullptr, uint32 *value=nullptr)
Get named typeinfo.
idaman uint32 ida_export copy_named_type(til_t *dsttil, const til_t *srctil, const char *name)
Copy a named type from one til to another.
@ TERR_ENUM_SIZE
bad enum size
Definition typeinf.hpp:2386
@ TERR_NOT_COMPAT
the new type is not compatible with the old type
Definition typeinf.hpp:2380
@ TERR_NOT_IMPL
not implemented
Definition typeinf.hpp:2387
@ TERR_NOT_FOUND
member not found
Definition typeinf.hpp:2391
@ TERR_BAD_OFFSET
bad member offset s
Definition typeinf.hpp:2363
@ TERR_BAD_ARG
bad argument
Definition typeinf.hpp:2357
@ TERR_BAD_GROUPS
bad group sizes for bitmask enum
Definition typeinf.hpp:2382
@ TERR_STRUCT_SIZE
bad fixed structure size
Definition typeinf.hpp:2390
@ TERR_BAD_NAME
name s is not acceptable
Definition typeinf.hpp:2356
@ TERR_BAD_FX_SIZE
cannot extend struct beyond fixed size
Definition typeinf.hpp:2389
@ TERR_BAD_GAP
bad gap
Definition typeinf.hpp:2378
@ TERR_BAD_VARLAST
variable sized member must be the last member in the structure
Definition typeinf.hpp:2365
@ TERR_BAD_BF
bitfields are forbidden as function arguments
Definition typeinf.hpp:2362
@ TERR_BAD_BMASK
Bad enum member mask 0xI64X. The specified mask should not intersect with any existing mask in the en...
Definition typeinf.hpp:2370
@ TERR_BAD_BASE
bad base class
Definition typeinf.hpp:2377
@ TERR_STOCK
stock type info cannot be modified
Definition typeinf.hpp:2385
@ TERR_BAD_TAH
bad bits in the type attributes (TAH bits)
Definition typeinf.hpp:2376
@ TERR_BAD_REPR
bad or incompatible field representation
Definition typeinf.hpp:2372
@ TERR_UNION_BF
unions cannot have bitfields
Definition typeinf.hpp:2375
@ TERR_BAD_MSKVAL
bad bmask and value combination (value=0xI64X; bitmask 0xI64X)
Definition typeinf.hpp:2371
@ TERR_GRP_NOEMPTY
could not delete group mask for not empty group 0xI64X
Definition typeinf.hpp:2373
@ TERR_SERIALIZE
failed to serialize
Definition typeinf.hpp:2355
@ TERR_BAD_TYPE
bad type
Definition typeinf.hpp:2358
@ TERR_BAD_ARRAY
arrays are forbidden as function arguments
Definition typeinf.hpp:2361
@ TERR_TYPE_WORSE
the new type is worse than the old type
Definition typeinf.hpp:2388
@ TERR_NO_BMASK
bitmask 0xI64X is not found
Definition typeinf.hpp:2369
@ TERR_OVERLAP
the member overlaps with other members that cannot be deleted
Definition typeinf.hpp:2366
@ TERR_ALIEN_NAME
enum member name is used in another enum
Definition typeinf.hpp:2384
@ TERR_COUNT
Definition typeinf.hpp:2392
@ TERR_DUPNAME
duplicate name s
Definition typeinf.hpp:2374
@ TERR_BAD_SERIAL
enum value has too many serials
Definition typeinf.hpp:2383
@ TERR_BAD_UNIVAR
unions cannot have variable sized members
Definition typeinf.hpp:2364
@ TERR_BAD_LAYOUT
failed to calculate the structure/union layout
Definition typeinf.hpp:2381
@ TERR_BAD_SUBTYPE
recursive structure nesting is forbidden
Definition typeinf.hpp:2367
@ TERR_BAD_SIZE
bad size d
Definition typeinf.hpp:2359
@ TERR_OK
ok
Definition typeinf.hpp:2353
@ TERR_BAD_VALUE
value 0xI64X is not acceptable
Definition typeinf.hpp:2368
@ TERR_BAD_INDEX
bad index d
Definition typeinf.hpp:2360
@ TERR_NESTED
recursive structure nesting is forbidden
Definition typeinf.hpp:2379
@ TERR_SAVE_ERROR
failed to save
Definition typeinf.hpp:2354
idaman bool ida_export is_ordinal_name(const char *name, uint32 *ord=nullptr)
Check if the name is an ordinal name.
idaman bool ida_export is_type_choosable(const til_t *ti, uint32 ordinal)
Check if a struct/union type is choosable.
idaman uint32 ida_export alloc_type_ordinals(til_t *ti, int qty)
Allocate a range of ordinal numbers for new types.
idaman uint32 ida_export get_ordinal_limit(const til_t *ti=nullptr)
Get number of allocated ordinals + 1.
idaman int32 ida_export get_type_ordinal(const til_t *ti, const char *name)
Get type ordinal by its name.
uint32 alloc_type_ordinal(til_t *ti)
alloc_type_ordinals(ti, 1)
Definition typeinf.hpp:2531
idaman const char *ida_export get_numbered_type_name(const til_t *ti, uint32 ordinal)
Get type name (if exists) by its ordinal.
idaman void ida_export set_type_choosable(til_t *ti, uint32 ordinal, bool value)
Enable/disable 'choosability' flag for a struct/union type.
idaman bool ida_export del_numbered_type(til_t *ti, uint32 ordinal)
Delete a numbered type.
idaman bool ida_export get_numbered_type(const til_t *ti, uint32 ordinal, const type_t **type=nullptr, const p_list **fields=nullptr, const char **cmt=nullptr, const p_list **fieldcmts=nullptr, sclass_t *sclass=nullptr)
Retrieve a type by its ordinal number.
idaman uint32 ida_export get_alias_target(const til_t *ti, uint32 ordinal)
Find the final alias destination.
idaman bool ida_export set_type_alias(til_t *ti, uint32 src_ordinal, uint32 dst_ordinal)
Create a type alias.
idaman bool ida_export enable_numbered_types(til_t *ti, bool enable)
Enable the use of numbered types in til.
idaman ssize_t ida_export create_numbered_type_name(qstring *buf, int32 ord)
Create anonymous name for numbered type.
uint32 get_ordinal_count(const til_t *ti=nullptr)
Get number of allocated ordinals.
Definition typeinf.hpp:2548
idaman int ida_export compact_numbered_types(til_t *ti, uint32 min_ord=0, intvec_t *p_ordmap=nullptr, int flags=0)
Compact numbered types to get rid of empty slots.
int idaapi h2ti_type_cb(const char *name, const tinfo_t &tif, const char *cmt, const uint64 *value, void *cb_data)
This callback will be called for each type/variable declaration.
Definition typeinf.hpp:2121
idaman bool ida_export print_type(qstring *out, ea_t ea, int prtype_flags)
Get type declaration for the specified address.
idaman int ida_export h2ti(til_t *ti, lexer_t *lx, const char *input, int flags=HTI_HIGH, h2ti_type_cb *type_cb=nullptr, h2ti_type_cb *var_cb=nullptr, printer_t *print_cb=nullptr, void *_cb_data=nullptr, abs_t _isabs=ABS_UNK)
Convert declarations to type_t*.
Definition typeinf.hpp:2147
idaman bool ida_export parse_decl(tinfo_t *out_tif, qstring *out_name, til_t *til, const char *decl, int pt_flags)
Parse ONE declaration.
typedef AS_PRINTF(1, 2) int printer_t(const char *format
Specify a printing callback when parsing types.
idaman int ida_export parse_decls(til_t *til, const char *input, printer_t *printer, int hti_flags)
Parse many declarations and store them in a til.
THREAD_SAFE int convert_pt_flags_to_hti(int pt_flags)
Convert Type parsing flags to Type formatting flags.
Definition typeinf.hpp:2163
idaman THREAD_SAFE const char * format
Definition fpro.h:78
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:1000
const type_sign_t type_unsigned
unsigned type
Definition typeinf.hpp:676
qvector< type_attr_t > type_attrs_t
this vector must be sorted by keys
Definition typeinf.hpp:670
int type_sign_t
type signedness
Definition typeinf.hpp:672
const type_sign_t no_sign
no sign, or unknown
Definition typeinf.hpp:674
const type_sign_t type_signed
signed type
Definition typeinf.hpp:675
DECLARE_TYPE_AS_MOVABLE(type_attr_t)
const type_t BTMT_NONBASED
Definition typeinf.hpp:233
const type_t BTMT_ARRESERV
reserved bit
Definition typeinf.hpp:241
const type_t BT_ARRAY
array
Definition typeinf.hpp:232
const type_t BT_BOOL
bool
Definition typeinf.hpp:181
const type_t BTMT_BOOL8
size 8 bytes - inf_is_64bit()
Definition typeinf.hpp:185
const type_t BTMT_BOOL2
size 2 bytes - !inf_is_64bit()
Definition typeinf.hpp:184
const type_t BTMT_BOOL4
size 4 bytes
Definition typeinf.hpp:186
const type_t BTMT_DEFBOOL
size is model specific or unknown(?)
Definition typeinf.hpp:182
const type_t BTMT_BOOL1
size 1 byte
Definition typeinf.hpp:183
const type_t BTMT_BFLDI16
__int16
Definition typeinf.hpp:327
const type_t BT_BITFIELD
bitfield (only in struct) ['bitmasked' enum see below] next byte is dt ((size in bits << 1) | (unsign...
Definition typeinf.hpp:322
const type_t BTMT_BFLDI32
__int32
Definition typeinf.hpp:328
const type_t BTMT_BFLDI64
__int64
Definition typeinf.hpp:329
const type_t BT_COMPLEX
struct/union/enum/typedef.
Definition typeinf.hpp:287
const type_t BTMT_ENUM
enum: next byte bte_t (see below) N records: de delta(s) OR blocks (see below)
Definition typeinf.hpp:314
const type_t BTMT_TYPEDEF
named reference always p_string name
Definition typeinf.hpp:319
const type_t BTMT_BFLDI8
__int8
Definition typeinf.hpp:326
const type_t BTMT_STRUCT
struct: MCNT records: type_t; [sdacl-typeattrs];
Definition typeinf.hpp:310
const type_t BTMT_UNION
union: MCNT records: type_t...
Definition typeinf.hpp:312
const type_t BT_SEGREG
segment register
Definition typeinf.hpp:373
const type_t BT_UNK_DWORD
4 bytes
Definition typeinf.hpp:380
const type_t BT_UNKNOWN
unknown size - for parameters
Definition typeinf.hpp:383
const type_t BT_UNK_BYTE
1 byte
Definition typeinf.hpp:378
const type_t BT_UNK_QWORD
8 bytes
Definition typeinf.hpp:381
const type_t BT_UNK_OWORD
16 bytes
Definition typeinf.hpp:382
const type_t BT_UNK_WORD
2 bytes
Definition typeinf.hpp:379
const bte_t BTE_HEX
hex
Definition typeinf.hpp:364
const bte_t BTE_UDEC
unsigned decimal
Definition typeinf.hpp:367
const bte_t BTE_RESERVED
must be 0, in order to distinguish from a tah-byte
Definition typeinf.hpp:353
uchar bte_t
Enum type flags.
Definition typeinf.hpp:347
const bte_t BTE_BITMASK
'subarrays'.
Definition typeinf.hpp:355
const bte_t BTE_CHAR
char or hex
Definition typeinf.hpp:365
const bte_t BTE_SDEC
signed decimal
Definition typeinf.hpp:366
const bte_t BTE_ALWAYS
this bit MUST be present
Definition typeinf.hpp:368
const bte_t BTE_SIZE_MASK
storage size.
Definition typeinf.hpp:349
const bte_t BTE_OUT_MASK
output style mask
Definition typeinf.hpp:363
const type_t BTMT_SPECFLT
float (variable size).
Definition typeinf.hpp:195
const type_t BTMT_LNGDBL
long double (compiler specific)
Definition typeinf.hpp:194
const type_t BT_FLOAT
float
Definition typeinf.hpp:191
const type_t BTMT_FLOAT
float (4 bytes)
Definition typeinf.hpp:192
const type_t BTMT_DOUBLE
double (8 bytes)
Definition typeinf.hpp:193
const type_t BTMT_FARCALL
function returns by retf
Definition typeinf.hpp:280
const type_t BTMT_DEFCALL
call method - default for model or unknown
Definition typeinf.hpp:278
const type_t BT_FUNC
function.
Definition typeinf.hpp:249
const type_t BTMT_NEARCALL
function returns by retn
Definition typeinf.hpp:279
const type_t BTMT_INTCALL
function returns by iret in this case cc MUST be 'unknown'
Definition typeinf.hpp:281
const type_t BT_INT
natural int. (size provided by idp module)
Definition typeinf.hpp:168
const type_t BT_INT16
__int16
Definition typeinf.hpp:164
const type_t BTMT_UNKSIGN
unknown signedness
Definition typeinf.hpp:169
const type_t BT_INT64
__int64
Definition typeinf.hpp:166
const type_t BT_INT128
__int128 (for alpha & future use)
Definition typeinf.hpp:167
const type_t BTMT_CHAR
specify char or segment register
Definition typeinf.hpp:173
const type_t BT_INT32
__int32
Definition typeinf.hpp:165
const type_t BTMT_UNSIGNED
Definition typeinf.hpp:172
const type_t BT_INT8
__int8
Definition typeinf.hpp:163
const type_t BTMT_USIGNED
unsigned
Definition typeinf.hpp:171
const type_t BTMT_SIGNED
signed
Definition typeinf.hpp:170
const type_t _BT_LAST_BASIC
the last basic type, all basic types may be followed by [tah-typeattrs]
Definition typeinf.hpp:202
const type_t TYPE_FULL_MASK
basic type with type flags
Definition typeinf.hpp:136
const type_t TYPE_FLAGS_MASK
type flags - they have different meaning depending on the basic type
Definition typeinf.hpp:130
const type_t TYPE_BASE_MASK
the low 4 bits define the basic type
Definition typeinf.hpp:129
const type_t TYPE_MODIF_MASK
modifiers.
Definition typeinf.hpp:132
const type_t BTM_CONST
const
Definition typeinf.hpp:340
const type_t BTM_VOLATILE
volatile
Definition typeinf.hpp:341
const type_t BTMT_CLOSURE
closure.
Definition typeinf.hpp:217
const type_t BT_PTR
pointer.
Definition typeinf.hpp:211
const type_t BTMT_NEAR
near
Definition typeinf.hpp:215
const type_t BTMT_DEFPTR
default for model
Definition typeinf.hpp:214
const type_t BTMT_FAR
far
Definition typeinf.hpp:216
const type_t BTF_INT64
signed long
Definition typeinf.hpp:404
const type_t BTF_UNION
union
Definition typeinf.hpp:422
const type_t BTF_UINT16
unsigned short
Definition typeinf.hpp:399
const type_t BTF_DOUBLE
double
Definition typeinf.hpp:417
const type_t BTF_UNK
unknown
Definition typeinf.hpp:390
const type_t BTF_UINT128
unsigned 128-bit value
Definition typeinf.hpp:408
const type_t BTF_INT16
signed short
Definition typeinf.hpp:398
const type_t BTF_UINT64
unsigned long
Definition typeinf.hpp:405
const type_t BTF_BYTE
byte
Definition typeinf.hpp:389
const type_t BTF_UINT
unsigned int
Definition typeinf.hpp:411
const type_t BTF_UINT32
unsigned int
Definition typeinf.hpp:402
const type_t BTF_ENUM
enum
Definition typeinf.hpp:423
const type_t BTF_TYPEDEF
typedef
Definition typeinf.hpp:424
const type_t BTF_UCHAR
unsigned char
Definition typeinf.hpp:395
const type_t BTF_STRUCT
struct
Definition typeinf.hpp:421
const type_t BTF_VOID
void
Definition typeinf.hpp:391
const type_t BTF_CHAR
signed char
Definition typeinf.hpp:394
const type_t BTF_LDOUBLE
long double
Definition typeinf.hpp:418
const type_t BTF_TBYTE
see BTMT_SPECFLT
Definition typeinf.hpp:419
const type_t BTF_INT8
signed byte
Definition typeinf.hpp:393
const type_t BTF_INT
int, unknown signedness
Definition typeinf.hpp:410
const type_t BTF_INT128
signed 128-bit value
Definition typeinf.hpp:407
const type_t BTF_INT32
signed int
Definition typeinf.hpp:401
const type_t BTF_FLOAT
float
Definition typeinf.hpp:416
const type_t BTF_UINT8
unsigned byte
Definition typeinf.hpp:396
const type_t BTF_SINT
signed int
Definition typeinf.hpp:412
const type_t BTF_BOOL
boolean
Definition typeinf.hpp:414
const type_t BTMT_SIZE12
size = 1 byte if BT_VOID; 2 if BT_UNK
Definition typeinf.hpp:155
const type_t BT_UNK
unknown
Definition typeinf.hpp:152
const type_t BTMT_SIZE48
size = 4 bytes if BT_VOID; 8 if BT_UNK
Definition typeinf.hpp:156
const type_t BTMT_SIZE128
size = 16 bytes if BT_VOID; unknown if BT_UNK (IN struct alignment - see below)
Definition typeinf.hpp:157
const type_t BTMT_SIZE0
BT_VOID - normal void; BT_UNK - don't use
Definition typeinf.hpp:154
const type_t BT_VOID
void
Definition typeinf.hpp:153
const type_t BT_RESERVED
RESERVED.
Definition typeinf.hpp:332
idaman uint32 ida_export get_tid_ordinal(tid_t tid)
Get type ordinal number for TID.
idaman bool ida_export get_idainfo_by_udm(flags64_t *flags, opinfo_t *ti, const udm_t &udm, ea_t refinfo_ea=BADADDR)
Calculate IDA info from udt member.
idaman bool ida_export resolve_field_path(field_path_t *out, const til_t *til, const char *dotted_path)
Resolve a dotted field path like "Top.Field1.Field2.Leaf".
tid_t get_tid() const
Definition typeinf.hpp:6397
idaman tid_t ida_export get_named_type_tid(const char *name)
Get named local type TID.
idaman ssize_t ida_export get_udm_by_fullname(udm_t *udm, const char *fullname)
Get udt member by full name.
idaman bool ida_export get_tid_name(qstring *out, tid_t tid)
Get a type name for the specified TID.
tid_t create_enum_type(const char *enum_name, enum_type_data_t &ei, int enum_width, type_sign_t sign, bool convert_to_bitmask, const char *enum_cmt=nullptr)
Create type enum.
Definition typeinf.hpp:6444
bool del_vftable_ea(uint32 ordinal)
Delete the address of a vftable instance for a vftable type.
Definition typeinf.hpp:2657
idaman uint32 ida_export get_vftable_ordinal(ea_t vftable_ea)
Get ordinal number of the virtual function table.
idaman bool ida_export set_vftable_ea(uint32 ordinal, ea_t vftable_ea)
Set the address of a vftable instance for a vftable type.
idaman ea_t ida_export get_vftable_ea(uint32 ordinal)
Get address of a virtual function table.
cexpr_t * e
Definition hexrays.hpp:7705
const tinfo_t & type
Definition hexrays.hpp:7698
@ INF_H_PATH
C header path.
Definition ida.hpp:520
@ INF_C_MACROS
C predefined macros.
Definition ida.hpp:521
bool inf_big_arg_align(void)
Definition ida.hpp:982
uchar inf_get_cc_defalign()
Definition ida.hpp:1026
uint32 inf_get_abibits()
Definition ida.hpp:976
uchar inf_get_cc_size_e()
Definition ida.hpp:1023
qvector< callcnv_t > callcnvs_t
Definition ida.hpp:76
uchar cm_t
calling convention and memory model
Definition ida.hpp:74
callcnv_t inf_get_callcnv()
Definition ida.hpp:1014
uint32 callcnv_t
Definition ida.hpp:75
bool inf_is_64bit(void)
Definition ida.hpp:638
idaman ssize_t ida_export getinf_str(qstring *buf, inftag_t tag)
Get program specific information (a non-scalar value)
idaman bool ida_export setinf_buf(inftag_t tag, const void *buf, size_t bufsize=0)
Set program specific information.
uchar comp_t
target compiler id
Definition ida.hpp:73
bool inf_huge_arg_align(void)
Definition ida.hpp:996
bool inf_set_callcnv(callcnv_t _v)
Definition ida.hpp:1015
bool inf_pack_stkargs(void)
Definition ida.hpp:980
comp_t inf_get_cc_id()
Definition ida.hpp:1008
Contains definition of the interface to IDP modules.
qvector< reg_info_t > reginfovec_t
vector of register info objects
Definition idp.hpp:2966
int nbytes
Definition kernwin.hpp:3037
bool ok
Definition kernwin.hpp:7410
uval_t uval_t
Definition kernwin.hpp:1926
ssize_t rc
Definition kernwin.hpp:7505
qvector< uint32 > ordvec_t
Definition kernwin.hpp:1766
idaman size_t len
Definition kernwin.hpp:1389
asize_t size
Definition kernwin.hpp:6701
uint64 tif_cursor_t
A location in a tinfo_t.
Definition kernwin.hpp:1930
void(idaapi *range_marker)(ea_t ea
Pointer to range marker function (for idaviews and hexviews) This pointer is initialized by setup_ran...
bool result
Definition kernwin.hpp:8332
int idaapi til_tinfo_predicate_t(uint32 ord, const tinfo_t &type, void *ud)
Controls which types are displayed/selected when choosing a types from a library.
Definition kernwin.hpp:2165
cast_t token_t * ct
Definition lex.hpp:172
unsigned __int64 uint64
Definition llong.hpp:13
qvector< qstring > qstrvec_t
Definition lumina.hpp:831
idaman bool ida_export get_tinfo(tinfo_t *tif, ea_t ea)
uchar type_t
In serialized form, a type is represented by a byte sequence.
Definition nalt.hpp:1312
flags_t aflags_t
Definition nalt.hpp:288
uchar p_list
several p_string's
Definition nalt.hpp:1313
Functions that deal with names.
idaman size_t const char time_t t
Definition pro.h:606
unsigned short uint16
unsigned 16 bit value
Definition pro.h:350
int bool
Definition pro.h:333
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
qvector< int > intvec_t
vector of integers
Definition pro.h:2839
uint64 asize_t
Definition pro.h:427
constexpr T make_mask(int count)
Make a mask of 'count' bits.
Definition pro.h:1524
T align_up(T val, int elsize)
Align element up to nearest boundary.
Definition pro.h:4721
adiff_t sval_t
signed value used by the processor.
Definition pro.h:450
short int16
signed 16 bit value
Definition pro.h:349
int64 adiff_t
Definition pro.h:428
uint64 ea_t
Definition pro.h:425
int int32
signed 32 bit value
Definition pro.h:351
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1728
idaman size_t bufsize
Definition pro.h:604
_qstring< uchar > qtype
type string
Definition pro.h:3772
unsigned int uint
unsigned 32 bit value
Definition pro.h:343
int error_t
Error code (errno)
Definition pro.h:462
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2838
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5106
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
unsigned short ushort
unsigned 16 bit value
Definition pro.h:342
T align_down(T val, int elsize)
Align element down to nearest boundary.
Definition pro.h:4731
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' is not zero.
Definition pro.h:1530
ea_t tid_t
type id (for enums, structs, etc)
Definition pro.h:5107
constexpr bool is_pow2(T val)
is power of 2? (or zero)
Definition pro.h:1435
_qstring< char > qstring
regular string
Definition pro.h:3771
idaman int ida_export log2ceil(uint64 d64)
calculate ceil(log2(d64)) or floor(log2(d64)), it returns 0 if d64 == 0
int compare(const T &a, const T &b)
Definition pro.h:4607
unsigned int
Definition pronet.h:99
void swap(qpair< F, S > &a, qpair< F, S > &b) noexcept(noexcept(a.swap(b)))
Definition qpair.hpp:78
Visit all argument locations.
Definition typeinf.hpp:1387
virtual ~aloc_visitor_t()
Definition typeinf.hpp:1389
virtual int idaapi visit_location(argloc_t &v, int off, int size)=0
Subsection of an argument location.
Definition typeinf.hpp:1317
bool operator<(const argpart_t &r) const
Compare two argparts, based on their offset.
Definition typeinf.hpp:1332
DEFINE_MEMORY_ALLOCATION_FUNCS() argpart_t(const argloc_t &a)
Constructor.
Definition typeinf.hpp:1320
argpart_t()
Constructor.
Definition typeinf.hpp:1322
ushort size
the number of bytes
Definition typeinf.hpp:1319
void swap(argpart_t &r)
Assign this = r and r = this.
Definition typeinf.hpp:1335
ushort off
offset from the beginning of the argument
Definition typeinf.hpp:1318
bool bad_size() const
Does this argpart have a valid size?
Definition typeinf.hpp:1329
bool bad_offset() const
Does this argpart have a valid offset?
Definition typeinf.hpp:1326
argpart_t & copy_from(const argloc_t &a)
Definition typeinf.hpp:1323
Definition typeinf.hpp:6207
virtual bool idaapi set_op_tinfo(const insn_t &insn, const op_t &x, const tinfo_t &tif, const char *name)=0
Set the operand type as specified.
virtual bool idaapi has_delay_slot(ea_t)
The call instruction with a delay slot?
Definition typeinf.hpp:6227
size_t reserved
Definition typeinf.hpp:6208
virtual ~argtinfo_helper_t()
Definition typeinf.hpp:6210
void use_arg_tinfos(ea_t caller, func_type_data_t *fti, funcargvec_t *rargs)
This function is to be called by the processor module in response to ev_use_arg_types.
Definition typeinf.hpp:6241
virtual bool idaapi is_stkarg_load(const insn_t &insn, int *src, int *dst)=0
Is the current insn a stkarg load?
int32 flags
Definition nalt.hpp:672
Array type information (see tinfo_t::get_array_details())
Definition typeinf.hpp:4740
array_type_data_t(uint32 b=0, uint32 n=0)
Constructor.
Definition typeinf.hpp:4744
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(array_type_data_t &r)
set this = r and r = this
Definition typeinf.hpp:4745
uint32 nelems
number of elements
Definition typeinf.hpp:4743
tinfo_t elem_type
element type
Definition typeinf.hpp:4741
uint32 base
array base
Definition typeinf.hpp:4742
Bitfield type information (see tinfo_t::get_bitfield_details())
Definition typeinf.hpp:5684
void swap(bitfield_type_data_t &r)
Definition typeinf.hpp:5711
uchar nbytes
enclosing type size (1,2,4,8 bytes)
Definition typeinf.hpp:5685
uchar width
number of bits
Definition typeinf.hpp:5686
bool is_unsigned
is bitfield unsigned?
Definition typeinf.hpp:5687
DECLARE_COMPARISONS(bitfield_type_data_t)
Definition typeinf.hpp:5693
bool serialize(qtype *type, type_t mods) const
bool is_valid_bitfield() const
Definition typeinf.hpp:5712
bitfield_type_data_t(uchar _nbytes=0, uchar _width=0, bool _is_unsigned=false)
Definition typeinf.hpp:5688
Information about the target compiler.
Definition ida.hpp:80
comp_t id
compiler id (see Compiler IDs)
Definition ida.hpp:81
cm_t cm
memory model and calling convention (see CM) see also get_cc/set_cc
Definition ida.hpp:82
callcnv_t _new_callcnv
Definition ida.hpp:92
Same as aloc_visitor_t, but may not modify the argloc.
Definition typeinf.hpp:1397
virtual ~const_aloc_visitor_t()
Definition typeinf.hpp:1399
virtual int idaapi visit_location(const argloc_t &v, int off, int size)=0
Description of a custom argloc.
Definition typeinf.hpp:979
tinfo_t * elem_tif
Definition typeinf.hpp:1061
bool(idaapi *get_tinfo)(tinfo_t *out
Retrieve type of the object at 'loc'.
const char * name
name of the custom argloc type. must be unique
Definition typeinf.hpp:981
bool(idaapi *deref_array)(argloc_t *out
Dereference the array pointed by 'arrloc': take member number 'n' (element size is 'elsize'),...
tinfo_t const argloc_t const tinfo_t asize_t n
Definition typeinf.hpp:1024
size_t const argloc_t & loc
Definition typeinf.hpp:1003
tinfo_t const argloc_t const tinfo_t size_t len
Definition typeinf.hpp:1064
const idc_value_t const value_union_t int qstring * errbuf
Definition typeinf.hpp:1050
tinfo_t const argloc_t const tinfo_t & array_tif
Definition typeinf.hpp:1023
int const rangeset_t * gaps
Definition typeinf.hpp:993
asize_t(idaapi *guess_array_size)(const argloc_t &loc
Retrieve size of array at 'loc' (number of elements)
tinfo_t const argloc_t & strloc
Definition typeinf.hpp:1012
size_t(idaapi *print_ptr_value)(char *buf
Get string containing a printable representation of the pointer at 'loc'.
const idc_value_t & idcv
Definition typeinf.hpp:1047
const argloc_t & src
Definition typeinf.hpp:984
bool(idaapi *deref_field)(argloc_t *out
Dereference the struct/union pointed by 'strloc': take member at offset 'off' (or use the field name)...
size_t bool * is_valid_ptr
Definition typeinf.hpp:1086
tinfo_t const argloc_t & ptrloc
Definition typeinf.hpp:1032
void(idaapi *cleanup)(argloc_t *loc)
Clear contents of loc before it is modified (may be nullptr)
void(idaapi *copy)(argloc_t *empty_dst
Copy src into empty_dst.
tinfo_t * tif
Definition typeinf.hpp:1011
bool(idaapi *verify)(const argloc_t &loc
May be nullptr.
tinfo_t const argloc_t const tinfo_t asize_t off
Definition typeinf.hpp:1014
const tinfo_t & string_tif
Definition typeinf.hpp:1055
int size
Definition typeinf.hpp:992
size_t bufsize
Definition typeinf.hpp:1002
asize_t(idaapi *calc_string_length)(const argloc_t &loc
Calc max natural string length at 'loc' in the debugged process memory.
bool(idaapi *write_value)(const argloc_t &loc
Update value at 'loc'.
size_t cbsize
size of this structure
Definition typeinf.hpp:980
size_t const argloc_t asize_t int praloc_flags
Definition typeinf.hpp:1005
int(idaapi *calc_number_of_children)(const argloc_t &loc
Calculate the number of children for the given location.
bool(idaapi *read_value)(value_union_t *value
Read the pointer at 'loc': retrieve value of a simple object.
bool(idaapi *get_string)(qstring *out
Retrieve string at 'loc' from the debugged process memory, returns quoted string value.
int const rangeset_t bool part_of_scattered
Definition typeinf.hpp:994
tinfo_t const argloc_t & arrloc
Definition typeinf.hpp:1022
tinfo_t const argloc_t const tinfo_t & struct_tif
Definition typeinf.hpp:1013
const idc_value_t const value_union_t & scalar_value
Definition typeinf.hpp:1048
const argloc_t & b
Definition typeinf.hpp:997
size_t(idaapi *print)(char *buf
Get textual description of the location (not the value at the location!)
tinfo_t const argloc_t const tinfo_t asize_t asize_t elsize
Definition typeinf.hpp:1025
bool(idaapi *deref_ptr)(argloc_t *out
Dereference the pointer at 'loc': retrieve location of the pointed object, improve 'tif' of the point...
Description of a custom calling convention.
Definition typeinf.hpp:1553
virtual ssize_t find_varargs(func_type_data_t *fti, ea_t call_ea, class mblock_t *blk) const
Discover variadic arguments.
Definition typeinf.hpp:1602
virtual bool calc_retloc(func_type_data_t *fti) const =0
Calculate the location of the return value.
uint32 abibits
abibits to be used for the calling convention
Definition typeinf.hpp:1560
int cbsize
Definition typeinf.hpp:1554
bool is_purging() const
Definition typeinf.hpp:1563
virtual bool calc_arglocs(func_type_data_t *fti) const =0
Calculate the argument locations.
DECLARE_COMPARISONS(custom_callcnv_t)
custom_callcnv_t(const char *_name, uint64 f, uint32 _abibits)
Definition typeinf.hpp:1682
uint64 flags
Definition typeinf.hpp:1555
bool is_vararg() const
Definition typeinf.hpp:1562
virtual bool get_cc_regs(callregs_t *out) const
Retrieve generic information about call registers.
Definition typeinf.hpp:1635
virtual int lower_func_type(func_type_data_t *fti) const
Lower a function type.
Definition typeinf.hpp:1675
virtual int calc_purged_bytes(const func_type_data_t &fti, ea_t call_ea=BADADDR) const
Calculate the number of purged bytes.
Definition typeinf.hpp:1651
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.
Definition typeinf.hpp:1621
qstring name
the name is used as a keyword in the function prototype
Definition typeinf.hpp:1559
custom_callcnv_t()=default
virtual bool validate_func(const func_type_data_t &fti, qstring *reterr) const
Validate a function prototype.
Definition typeinf.hpp:1572
virtual bool get_stkarg_area_info(stkarg_area_info_t *out) const
Retrieve generic information about stack arguments.
Definition typeinf.hpp:1642
virtual ~custom_callcnv_t()
Definition typeinf.hpp:1685
bool is_usercall() const
Definition typeinf.hpp:1564
Definition typeinf.hpp:5287
int16 fid
data format ids
Definition typeinf.hpp:5289
int16 dtid
data type id
Definition typeinf.hpp:5288
This structure describes an enum value.
Definition typeinf.hpp:4941
qstring name
Definition typeinf.hpp:4942
edm_t(const char *_name, uint64 _value, const char *_cmt=nullptr)
Create an enumeration value with the specified name and value.
Definition typeinf.hpp:4953
bool empty() const
Definition typeinf.hpp:4957
uint64 value
Definition typeinf.hpp:4944
void swap(edm_t &r)
Definition typeinf.hpp:4966
qstring cmt
Definition typeinf.hpp:4943
bool operator==(const edm_t &r) const
Definition typeinf.hpp:4959
bool operator!=(const edm_t &r) const
Definition typeinf.hpp:4965
Enum type information (see tinfo_t::get_enum_details())
Definition typeinf.hpp:4981
enum_type_data_t(bte_t _bte=BTE_ALWAYS|BTE_HEX)
Definition typeinf.hpp:4987
bool is_bin() const
Definition typeinf.hpp:5036
bool is_soct() const
Definition typeinf.hpp:5039
int for_all_groups(std::function< int(size_t grp_start, int grp_size)> v, bool skip_trivial=false) const
visit all enum groups, for bitmask enum only
Definition typeinf.hpp:5227
bool has_lzero() const
Definition typeinf.hpp:5042
bool is_sbin() const
Definition typeinf.hpp:5040
bool is_bf() const
is bitmask or ordinary enum?
Definition typeinf.hpp:5049
bte_t bte
enum member sizes (shift amount) and style.
Definition typeinf.hpp:4985
bool is_udec() const
Definition typeinf.hpp:5037
void add_constant(const char *name, uint64 value, const char *cmt=nullptr)
add constant for regular enum
Definition typeinf.hpp:5159
uchar get_serial(size_t index) const
returns serial for the constant
Definition typeinf.hpp:5176
bool is_char() const
Definition typeinf.hpp:5032
bool is_oct() const
Definition typeinf.hpp:5035
bool get_constant_group(size_t *group_start_index, size_t *group_size, size_t idx) const
get group parameters for the constant, valid for bitmask enum
Definition typeinf.hpp:5074
void set_lzero(bool on)
Definition typeinf.hpp:5043
bool set_nbytes(int nbytes)
set enum width (nbytes)
Definition typeinf.hpp:5058
intvec_t group_sizes
if present, specifies bitmask group sizes each non-trivial group starts with a mask member
Definition typeinf.hpp:4982
bool is_group_mask_at(size_t idx) const
is the enum member at IDX a non-trivial group mask?
Definition typeinf.hpp:5100
DEFINE_MEMORY_ALLOCATION_FUNCS() int get_enum_radix() const
Get enum constant radix.
Definition typeinf.hpp:4988
int for_all_constants(std::function< int(size_t idx, size_t grp_start, int grp_size)> v) const
visit all enum constants not bmasks
Definition typeinf.hpp:5194
bool is_shex() const
Definition typeinf.hpp:5038
tinfo_code_t set_value_repr(const value_repr_t &repr)
set enum radix and other representation info
Definition typeinf.hpp:5173
ssize_t find_member(uint64 value, uchar serial, size_t from=0, size_t to=size_t(-1), uint64 vmask=uint64(-1)) const
find member (constant or bmask) by value
Definition typeinf.hpp:5139
bool is_valid_group_sizes() const
is valid group sizes
Definition typeinf.hpp:5109
bool is_dec() const
Definition typeinf.hpp:5033
bool store_64bit_values() const
Definition typeinf.hpp:5046
void set_enum_radix(int radix, bool sign)
Set radix to display constants.
Definition typeinf.hpp:5019
bool is_number_signed() const
Definition typeinf.hpp:5011
int calc_nbytes() const
get the width of enum in bytes
Definition typeinf.hpp:5052
uint32 taenum_bits
Type attributes for enums
Definition typeinf.hpp:4984
bool is_hex() const
Definition typeinf.hpp:5034
tinfo_code_t get_value_repr(value_repr_t *repr) const
get enum radix and other representation info
Definition typeinf.hpp:5169
ssize_t find_member(const char *name, size_t from=0, size_t to=size_t(-1)) const
find member (constant or bmask) by name
Definition typeinf.hpp:5126
uint64 calc_mask() const
Definition typeinf.hpp:5045
void swap(enum_type_data_t &r)
swap two instances
Definition typeinf.hpp:5156
uchar get_max_serial(uint64 value) const
return the maximum serial for the value
Definition typeinf.hpp:5190
Result of resolve_field_path(): resolved leaf info plus disambiguation context.
Definition typeinf.hpp:6361
qvector< tid_t > stroff_path
ready-to-use op_stroff() path: top_tif's TID at [0], followed by one member TID per union descent (in...
Definition typeinf.hpp:6367
tinfo_t leaf_tif
type of the leaf member (== top_tif if path is just a type name)
Definition typeinf.hpp:6363
uint64 cumul_bitoff
cumulative bit offset of the leaf member from top of top_tif
Definition typeinf.hpp:6366
tinfo_t top_tif
top-level type (after resolving first segment)
Definition typeinf.hpp:6362
tid_t leaf_udm_tid
TID of the leaf member, or BADADDR if path is just a type name (no member at the end of the path)
Definition typeinf.hpp:6364
Function type information (see tinfo_t::get_func_details())
Definition typeinf.hpp:4829
bool is_noret() const
Definition typeinf.hpp:4876
bool is_pure() const
Definition typeinf.hpp:4877
bool is_vararg_cc() const
Definition typeinf.hpp:4887
callcnv_t _new_callcnv
Definition typeinf.hpp:4863
bool is_swiftthrows() const
Definition typeinf.hpp:4885
bool is_ctor() const
Definition typeinf.hpp:4881
uval_t stkargs
size of stack arguments (not used in build_func_type)
Definition typeinf.hpp:4866
bool is_synchronized() const
Definition typeinf.hpp:4883
void set_cc(callcnv_t cc)
Definition typeinf.hpp:4873
bool is_high() const
Definition typeinf.hpp:4875
callcnv_t get_cc() const
Definition typeinf.hpp:4872
bool is_user_cc() const
Definition typeinf.hpp:4891
int flags
Function type data property bits
Definition typeinf.hpp:4830
bool is_static() const
Definition typeinf.hpp:4878
bool is_virtual() const
Definition typeinf.hpp:4879
callcnv_t guess_cc(int purged, int cc_flags) const
Guess function calling convention use the following info: argument locations and 'stkargs'.
Definition typeinf.hpp:4895
ssize_t find_argument(const char *name, size_t from=0, size_t to=size_t(-1)) const
find argument by name
Definition typeinf.hpp:4913
int get_call_method() const
Definition typeinf.hpp:4886
bool is_swift_cc() const
Definition typeinf.hpp:4890
reginfovec_t spoiled
spoiled register information.
Definition typeinf.hpp:4867
argloc_t retloc
return location
Definition typeinf.hpp:4865
bool is_const() const
Definition typeinf.hpp:4880
bool is_dtor() const
Definition typeinf.hpp:4882
bool is_swiftasync() const
Definition typeinf.hpp:4884
cm_t _old_cc
Definition typeinf.hpp:4870
void swap(func_type_data_t &r)
Definition typeinf.hpp:4874
bool is_rust_cc() const
Definition typeinf.hpp:4889
bool dump(qstring *out, int praloc_bits=PRALOC_STKOFF) const
Dump information that is not always visible in the function prototype.
Definition typeinf.hpp:4907
bool is_golang_cc() const
Definition typeinf.hpp:4888
tinfo_t rettype
return type
Definition typeinf.hpp:4864
callcnv_t get_explicit_cc() const
Definition typeinf.hpp:4871
Information about a single function argument.
Definition typeinf.hpp:4753
tinfo_t type
argument type
Definition typeinf.hpp:4757
argloc_t argloc
argument location
Definition typeinf.hpp:4754
qstring cmt
argument comment (may be empty)
Definition typeinf.hpp:4756
bool operator!=(const funcarg_t &r) const
Definition typeinf.hpp:4821
qstring name
argument name (may be empty)
Definition typeinf.hpp:4755
bool is_swiftself() const
Definition typeinf.hpp:4777
funcarg_t(const char *_name, const char *_type, const argloc_t &_argloc=argloc_t())
Create a function argument, with the specified name and type.
Definition typeinf.hpp:4808
uint32 flags
Function argument property bits
Definition typeinf.hpp:4758
funcarg_t(const char *_name, const tinfo_t &_type, const argloc_t &_argloc=argloc_t())
Create a function argument, with the specified name and arbitrary type.
Definition typeinf.hpp:4784
bool operator==(const funcarg_t &r) const
Definition typeinf.hpp:4814
funcarg_t(const char *_name, const type_t _type, const argloc_t &_argloc=argloc_t())
Create a function argument, with the specified name and simple type.
Definition typeinf.hpp:4795
Helper class for choose_named_type().
Definition typeinf.hpp:6709
virtual bool idaapi should_display(const til_t *til, const char *name, const type_t *type, const p_list *fields)=0
virtual ~predicate_t()
Definition typeinf.hpp:6715
@ ev_decorate_name
Decorate/undecorate a C symbol name.
Definition idp.hpp:1868
@ ev_equal_reglocs
Are 2 register arglocs the same?
Definition idp.hpp:1825
static ssize_t equal_reglocs(const argloc_t &a1, const argloc_t &a2)
Definition typeinf.hpp:6768
static ssize_t notify(event_t event_code,...)
Definition idp.hpp:1927
static ssize_t get_cc_regs(callregs_t *regs, callcnv_t cc)
Definition idp.hpp:2851
static ssize_t _decorate_name(qstring *outbuf, const char *name, bool mangle, callcnv_t cc, const tinfo_t &type)
Definition typeinf.hpp:6777
Pointer type information (see tinfo_t::get_ptr_details())
Definition typeinf.hpp:4710
bool operator!=(const ptr_type_data_t &r) const
Definition typeinf.hpp:4731
uchar based_ptr_size
Definition typeinf.hpp:4715
int32 delta
Offset from the beginning of the parent struct.
Definition typeinf.hpp:4714
bool operator==(const ptr_type_data_t &r) const
Definition typeinf.hpp:4725
bool is_shifted() const
Definition typeinf.hpp:4733
uchar taptr_bits
TAH bits.
Definition typeinf.hpp:4716
tinfo_t obj_type
pointed object type
Definition typeinf.hpp:4711
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(ptr_type_data_t &r)
Set this = r and r = this.
Definition typeinf.hpp:4723
tinfo_t closure
cannot have both closure and based_ptr_size
Definition typeinf.hpp:4712
ptr_type_data_t(tinfo_t c=tinfo_t(), uchar bps=0, tinfo_t p=tinfo_t(), int32 d=0)
Definition typeinf.hpp:4717
tinfo_t parent
Parent struct.
Definition typeinf.hpp:4713
bool is_code_ptr() const
Are we pointing to code?
Definition typeinf.hpp:4732
ea_t start_ea
start_ea included
Definition range.hpp:37
Information about a reference.
Definition nalt.hpp:1001
Object that represents a register.
Definition typeinf.hpp:6124
bytevec_t value
Definition typeinf.hpp:6127
size_t size() const
Definition typeinf.hpp:6128
int regidx
index into dbg->registers
Definition typeinf.hpp:6125
int relocate
0-plain num, 1-must relocate
Definition typeinf.hpp:6126
Definition typeinf.hpp:6133
Relocatable object.
Definition pro.h:4103
Register-relative argument location.
Definition typeinf.hpp:969
sval_t off
displacement from the address pointed by the register
Definition typeinf.hpp:970
int reg
register index (into ph.reg_names)
Definition typeinf.hpp:971
SIMD type info.
Definition typeinf.hpp:4638
uint16 size
SIMD type size in bytes (0-undefined, 0xFFFF-variadic)
Definition typeinf.hpp:4643
static constexpr uint16 SIMD_VARIADIC
Definition typeinf.hpp:4639
bool is_variadic() const
Definition typeinf.hpp:4656
bool operator!=(const simd_info_t &r) const
Definition typeinf.hpp:4683
type_t memtype
member type BTF_INT8/16/32/64/128, BTF_UINT8/16/32/64/128 BTF_INT - integrals of any size/sign BTF_FL...
Definition typeinf.hpp:4644
const char * name
name of SIMD type (nullptr-undefined)
Definition typeinf.hpp:4641
tinfo_t tif
SIMD type (empty-undefined)
Definition typeinf.hpp:4642
bool operator==(const simd_info_t &r) const
Definition typeinf.hpp:4675
bool match_pattern(const simd_info_t *pattern)
Definition typeinf.hpp:4658
simd_info_t(const char *nm=nullptr, uint16 sz=0, type_t memt=BTF_UNK)
Definition typeinf.hpp:4653
Definition typeinf.hpp:4686
Definition typeinf.hpp:1528
size_t cb
Definition typeinf.hpp:1529
bool get_info(callcnv_t cc)
Definition typeinf.hpp:1547
sval_t shadow_size
Size of the shadow area.
Definition typeinf.hpp:1538
sval_t linkage_area
Size of the linkage area.
Definition typeinf.hpp:1543
sval_t stkarg_offset
Offset from the SP to the first stack argument (can include linkage area) examples: pc: 0,...
Definition typeinf.hpp:1533
stkarg_area_info_t()=default
stkarg_area_info_t(callcnv_t cc)
Definition typeinf.hpp:1546
A single stkarg-store action returned by processor_t::get_stkarg_parts.
Definition typeinf.hpp:6197
int dst
destination operand index, or -1 for push semantics
Definition typeinf.hpp:6199
int src
source operand index in \insn_t{ops}
Definition typeinf.hpp:6198
sval_t off
when dst != -1, stack offset for this part (used in place of \insn_t{ops}[dst].addr); ignored for pus...
Definition typeinf.hpp:6200
Flush formatted text.
Definition typeinf.hpp:6609
virtual int idaapi print(const char *str)=0
virtual ~text_sink_t()
Definition typeinf.hpp:6610
A symbol in a type library.
Definition typeinf.hpp:6697
const til_t * til
pointer to til
Definition typeinf.hpp:6699
til_symbol_t(const char *n=nullptr, const til_t *t=nullptr)
Definition typeinf.hpp:6700
const char * name
symbol name
Definition typeinf.hpp:6698
Type Information Library.
Definition typeinf.hpp:728
uint32 flags
Type info library property bits
Definition typeinf.hpp:733
char * desc
human readable til description
Definition typeinf.hpp:730
compiler_info_t cc
information about the target compiler
Definition typeinf.hpp:767
til_stream_t ** streams
symbol stream storage
Definition typeinf.hpp:773
void set_dirty()
Mark the til as modified (TIL_MOD)
Definition typeinf.hpp:751
til_t * find_base(const char *n)
Find the base til with the provided name.
Definition typeinf.hpp:756
til_bucket_t * types
types
Definition typeinf.hpp:769
bool is_dirty() const
Has the til been modified? (TIL_MOD)
Definition typeinf.hpp:749
til_t ** base
tils that our til is based on
Definition typeinf.hpp:732
til_bucket_t * macros
macros
Definition typeinf.hpp:770
int nstreams
number of extra streams
Definition typeinf.hpp:772
char * name
short file name (without path and extension)
Definition typeinf.hpp:729
int nbases
number of base tils
Definition typeinf.hpp:731
til_bucket_t * syms
symbols
Definition typeinf.hpp:768
int nrefs
number of references to the til
Definition typeinf.hpp:771
Definition typeinf.hpp:6805
bool is_writable
Definition typeinf.hpp:6810
tif_cursor_t cursor
Definition typeinf.hpp:6808
bool is_detached
Definition typeinf.hpp:6811
udm_t udm
BTF_STRUCT or BTF_UNION: the current member.
Definition typeinf.hpp:6818
uint32 ordinal
Definition typeinf.hpp:6809
bool is_func() const
Definition typeinf.hpp:6840
size_t unpadded_size
Definition typeinf.hpp:6820
const funcarg_t * fa
BT_FUNC: the current argument, nullptr - ellipsis.
Definition typeinf.hpp:6832
bool is_enum() const
Definition typeinf.hpp:6839
type_t kind
Definition typeinf.hpp:6813
size_t total_size
Definition typeinf.hpp:6819
uint64 last_udm_offset
Definition typeinf.hpp:6821
bool is_forward
Definition typeinf.hpp:6812
bool is_union() const
Definition typeinf.hpp:6838
uint64 bucket_start
Definition typeinf.hpp:6822
uint64 offset
Definition typeinf.hpp:6824
void clear()
Definition typeinf.hpp:6834
int bf_bitoff
Definition typeinf.hpp:6823
tinfo_t tif
Definition typeinf.hpp:6807
bool on_member() const
Definition typeinf.hpp:6835
bool is_udt() const
Definition typeinf.hpp:6841
size_t cb
Definition typeinf.hpp:6806
bool is_struct() const
Definition typeinf.hpp:6837
size_t nmembers
Definition typeinf.hpp:6815
ssize_t memidx
Definition typeinf.hpp:6814
edm_t edm
BTF_ENUM: the current enum member.
Definition typeinf.hpp:6829
bool is_typedef() const
Definition typeinf.hpp:6836
virtual ~tinfo_visitor_t()
Definition typeinf.hpp:6094
virtual int idaapi visit_type(type_mods_t *out, const tinfo_t &tif, const char *name, const char *cmt)=0
Visit a subtype.
tinfo_visitor_t(int s=0)
Definition typeinf.hpp:6092
int apply_to(const tinfo_t &tif, type_mods_t *out=nullptr, const char *name=nullptr, const char *cmt=nullptr)
Call this function to initiate the traversal.
Definition typeinf.hpp:6112
int state
tinfo visitor states
Definition typeinf.hpp:6083
int level
Definition typeinf.hpp:6091
void prune_now()
To refuse to visit children of the current type, use this:
Definition typeinf.hpp:6109
Definition typeinf.hpp:652
qstring key
one-symbol keys are reserved to be used by the kernel the ones starting with an underscore are reserv...
Definition typeinf.hpp:653
bytevec_t value
attribute bytes
Definition typeinf.hpp:663
bool operator>=(const type_attr_t &r) const
Definition typeinf.hpp:665
bool operator<(const type_attr_t &r) const
Definition typeinf.hpp:664
Information about how to modify the current type, used by tinfo_visitor_t.
Definition typeinf.hpp:6046
bool has_name() const
Definition typeinf.hpp:6074
bool is_rptcmt() const
Definition typeinf.hpp:6076
bool has_type() const
Definition typeinf.hpp:6073
bool has_info() const
Definition typeinf.hpp:6077
qstring name
current type name
Definition typeinf.hpp:6048
tinfo_t type
current type
Definition typeinf.hpp:6047
int flags
Type modification bits
Definition typeinf.hpp:6050
bool has_cmt() const
Definition typeinf.hpp:6075
void set_new_cmt(const qstring &c, bool rptcmt)
Definition typeinf.hpp:6066
qstring cmt
comment for current type
Definition typeinf.hpp:6049
void clear()
Definition typeinf.hpp:6059
void set_new_name(const qstring &n)
Definition typeinf.hpp:6065
void set_new_type(const tinfo_t &t)
The visit_type() function may optionally save the modified type info.
Definition typeinf.hpp:6064
Type information for typedefs.
Definition typeinf.hpp:5257
bool resolve
should resolve immediately?
Definition typeinf.hpp:5265
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(typedef_type_data_t &r)
Definition typeinf.hpp:5279
uint32 ordinal
is_ordref=true: type ordinal number
Definition typeinf.hpp:5262
typedef_type_data_t(const til_t *_til, const char *_name, bool _resolve=false)
Definition typeinf.hpp:5266
const char * name
is_ordref=false: target type name. we do not own this pointer!
Definition typeinf.hpp:5261
typedef_type_data_t(const til_t *_til, uint32 ord, bool _resolve=false)
Definition typeinf.hpp:5272
bool is_ordref
is reference by ordinal?
Definition typeinf.hpp:5264
const til_t * til
type library to use when resolving
Definition typeinf.hpp:5258
An object to represent struct or union members.
Definition typeinf.hpp:5393
void set_unaligned(bool on=true)
Definition typeinf.hpp:5474
bool is_zero_bitfield() const
Definition typeinf.hpp:5461
bool is_method() const
Definition typeinf.hpp:5466
void clr_virtbase()
Definition typeinf.hpp:5485
bool is_gap() const
Definition typeinf.hpp:5467
qstring cmt
member comment
Definition typeinf.hpp:5397
bool operator==(const udm_t &r) const
Definition typeinf.hpp:5494
bool is_retaddr() const
Definition typeinf.hpp:5469
bool is_unaligned() const
Definition typeinf.hpp:5462
void clr_unaligned()
Definition typeinf.hpp:5483
void set_savregs(bool on=true)
Definition typeinf.hpp:5481
void clr_vftable()
Definition typeinf.hpp:5486
bool compare_with(const udm_t &r, int tcflags) const
Definition typeinf.hpp:5498
udm_t(const char *_name, const type_t _type, uint64 _offset=0)
Create a structure/union member, with the specified name and simple type.
Definition typeinf.hpp:5431
uint32 tafld_bits
TAH bits.
Definition typeinf.hpp:5401
bool operator!=(const udm_t &r) const
Definition typeinf.hpp:5503
void clr_baseclass()
Definition typeinf.hpp:5484
uint64 end() const
Definition typeinf.hpp:5489
bool can_rename() const
Definition typeinf.hpp:5518
bool is_savregs() const
Definition typeinf.hpp:5470
bool operator<(const udm_t &r) const
Definition typeinf.hpp:5490
uint64 begin() const
Definition typeinf.hpp:5488
void set_vftable(bool on=true)
Definition typeinf.hpp:5477
bool is_vftable() const
Definition typeinf.hpp:5465
void set_retaddr(bool on=true)
Definition typeinf.hpp:5480
bool is_baseclass() const
Definition typeinf.hpp:5463
int effalign
effective field alignment (in bytes)
Definition typeinf.hpp:5400
uint64 offset
member offset in bits
Definition typeinf.hpp:5394
void set_baseclass(bool on=true)
Definition typeinf.hpp:5475
bool can_be_dtor() const
Definition typeinf.hpp:5517
bool is_by_til() const
Definition typeinf.hpp:5472
uint64 size
size in bits
Definition typeinf.hpp:5395
bool is_special_member() const
Definition typeinf.hpp:5471
udm_t(const char *_name, const tinfo_t &_type, uint64 _offset=0)
Create a structure/union member, with the specified name and arbitrary type.
Definition typeinf.hpp:5415
bool is_anonymous_udm() const
Definition typeinf.hpp:5511
uchar fda
field alignment (shift amount)
Definition typeinf.hpp:5402
void set_method(bool on=true)
Definition typeinf.hpp:5478
void clr_method()
Definition typeinf.hpp:5487
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(udm_t &r)
Definition typeinf.hpp:5505
value_repr_t repr
radix, refinfo, strpath, custom_id, strtype
Definition typeinf.hpp:5399
bool is_regcmt() const
Definition typeinf.hpp:5468
qstring name
member name
Definition typeinf.hpp:5396
void set_virtbase(bool on=true)
Definition typeinf.hpp:5476
tinfo_t type
member type
Definition typeinf.hpp:5398
void set_value_repr(const value_repr_t &r)
Definition typeinf.hpp:5516
void set_by_til(bool on=true)
Definition typeinf.hpp:5482
udm_t(const char *_name, const char *_type, uint64 _offset=0)
Create a structure/union member, with the specified name and type.
Definition typeinf.hpp:5450
void set_regcmt(bool on=true)
Definition typeinf.hpp:5479
bool empty() const
Definition typeinf.hpp:5458
bool is_bitfield() const
Definition typeinf.hpp:5460
bool is_virtbase() const
Definition typeinf.hpp:5464
Definition typeinf.hpp:5652
virtual int idaapi visit_udm(tid_t tid, const tinfo_t *tif, const udt_type_data_t *udt, ssize_t idx)=0
virtual ~udm_visitor_t()
Definition typeinf.hpp:5662
Definition typeinf.hpp:5528
ssize_t find_member(const char *name) const
Definition typeinf.hpp:5583
bool is_vftable() const
Definition typeinf.hpp:5544
void swap(udt_type_data_t &r)
Definition typeinf.hpp:5539
bool is_iface() const
Definition typeinf.hpp:5547
uchar pack
pragma pack() alignment (shift amount)
Definition typeinf.hpp:5536
bool is_tuple() const
Definition typeinf.hpp:5546
ssize_t get_best_fit_member(asize_t disp) const
Get the member that is most likely referenced by the specified offset.
Definition typeinf.hpp:5599
bool deduplicate_members()
Rename members with the same names.
Definition typeinf.hpp:5612
uchar sda
declared structure alignment (shift amount+1). 0 - unspecified
Definition typeinf.hpp:5535
ssize_t find_member(udm_t *pattern_udm, int strmem_flags) const
tinfo_t::find_udm
Definition typeinf.hpp:5581
static constexpr int VERSION
Definition typeinf.hpp:5529
udm_t & add_member(const char *_name, const tinfo_t &_type, uint64 _offset=0)
Add a new member to a structure or union.
Definition typeinf.hpp:5568
uint32 taudt_bits
TA... and TAUDT... bits.
Definition typeinf.hpp:5533
bool is_union
is union or struct?
Definition typeinf.hpp:5537
bool is_last_baseclass(size_t idx)
Definition typeinf.hpp:5554
bool is_cppobj() const
Definition typeinf.hpp:5543
void set_iface(bool on=true)
Definition typeinf.hpp:5552
bool is_fixed() const
Definition typeinf.hpp:5545
uint32 effalign
effective structure alignment (in bytes)
Definition typeinf.hpp:5532
void set_fixed(bool on=true)
Definition typeinf.hpp:5550
void set_tuple(bool on=true)
Definition typeinf.hpp:5551
bool is_msstruct() const
Definition typeinf.hpp:5542
DEFINE_MEMORY_ALLOCATION_FUNCS() bool is_unaligned() const
Definition typeinf.hpp:5540
void set_vftable(bool on=true)
Definition typeinf.hpp:5549
uchar version
version of udt_type_data_t
Definition typeinf.hpp:5534
size_t unpadded_size
unpadded structure size in bytes
Definition typeinf.hpp:5531
size_t total_size
total structure size in bytes
Definition typeinf.hpp:5530
ssize_t find_member(uint64 bit_offset) const
Definition typeinf.hpp:5590
vector of udt member objects
Definition typeinf.hpp:5525
Additional information about the output lines.
Definition typeinf.hpp:6521
void swap(valinfo_t &r)
Definition typeinf.hpp:6527
qstring label
Definition typeinf.hpp:6523
argloc_t loc
Definition typeinf.hpp:6522
tinfo_t type
Definition typeinf.hpp:6524
valinfo_t(argloc_t l=argloc_t(), const char *name=nullptr, const tinfo_t &tif=tinfo_t())
Definition typeinf.hpp:6525
Collection of value strings.
Definition typeinf.hpp:6582
Visual representation of a member of a complex type (struct/union/enum)
Definition typeinf.hpp:5294
bool is_offset() const
Definition typeinf.hpp:5339
void set_lzeroes(bool on)
Definition typeinf.hpp:5352
bool is_custom() const
Definition typeinf.hpp:5341
uint64 bits
Definition typeinf.hpp:5295
refinfo_t ri
FRB_OFFSET.
Definition typeinf.hpp:5319
bool is_enum() const
Definition typeinf.hpp:5338
uint32 type_ordinal
FRB_STROFF, FRB_ENUM.
Definition typeinf.hpp:5324
bool empty() const
Definition typeinf.hpp:5337
DEFINE_MEMORY_ALLOCATION_FUNCS() void clear()
Definition typeinf.hpp:5333
array_parameters_t ap
FRB_TABFORM, AP_SIGNED is ignored, use FRB_SIGNED instead.
Definition typeinf.hpp:5328
void swap(value_repr_t &r)
Definition typeinf.hpp:5332
bool is_typref() const
Definition typeinf.hpp:5343
uint64 get_vtype() const
Definition typeinf.hpp:5348
bool parse_value_repr(const qstring &attr, type_t target_type=BTF_STRUCT)
Definition typeinf.hpp:5379
DECLARE_COMPARISONS(value_repr_t)
adiff_t delta
FRB_STROFF.
Definition typeinf.hpp:5323
bool has_tabform() const
Definition typeinf.hpp:5345
bool from_opinfo(flags64_t flags, aflags_t afl, const opinfo_t *opinfo, const array_parameters_t *_ap)
Definition typeinf.hpp:5371
void init_ap(array_parameters_t *_ap) const
Definition typeinf.hpp:5361
void set_vtype(uint64 vt)
Definition typeinf.hpp:5349
int32 strtype
FRB_STRLIT.
Definition typeinf.hpp:5320
custom_data_type_info_t cd
FRB_CUSTOM.
Definition typeinf.hpp:5326
size_t print(qstring *result, bool colored=false) const
Definition typeinf.hpp:5375
bool is_signed() const
Definition typeinf.hpp:5344
bool has_lzeroes() const
Definition typeinf.hpp:5346
bool is_stroff() const
Definition typeinf.hpp:5342
bool is_strlit() const
Definition typeinf.hpp:5340
void set_tabform(bool on)
Definition typeinf.hpp:5351
void set_ap(const array_parameters_t &_ap)
Definition typeinf.hpp:5354
void set_signed(bool on)
Definition typeinf.hpp:5350
THREAD_SAFE bool is_type_uint32(type_t t)
See BTF_UINT32.
Definition typeinf.hpp:525
THREAD_SAFE bool is_type_ext_arithmetic(type_t t)
Is the type an extended arithmetic type? (arithmetic or enum)
Definition typeinf.hpp:520
THREAD_SAFE type_t get_base_type(type_t t)
Get basic type bits (TYPE_BASE_MASK)
Definition typeinf.hpp:435
idaman int ida_export calc_number_of_children(const argloc_t &loc, const tinfo_t &tif, bool dont_deref_ptr=false)
Calculate max number of lines of a formatted c data, when expanded (PTV_EXPAND).
idaman bool ida_export extract_argloc(argloc_t *vloc, const type_t **ptype, bool forbid_stkoff)
Deserialize an argument location.
THREAD_SAFE type_t get_full_type(type_t t)
Get basic type bits + type flags (TYPE_FULL_MASK)
Definition typeinf.hpp:437
idaman bool ida_export apply_named_type(ea_t ea, const char *name)
Apply the specified named type to the address.
idaman bool ida_export get_idainfo_by_type(size_t *out_size, flags64_t *out_flags, opinfo_t *out_mt, const tinfo_t &tif, size_t *out_alsize=nullptr)
Extract information from a tinfo_t.
THREAD_SAFE bool is_type_int16(type_t t)
Does the type specify a 16-bit value? (signed or unsigned, see Basic type: integer)
Definition typeinf.hpp:489
THREAD_SAFE bool is_type_func(type_t t)
See BT_FUNC.
Definition typeinf.hpp:451
idaman error_t ida_export pack_idcobj_to_idb(const idc_value_t *obj, const tinfo_t &tif, ea_t ea, int pio_flags=0)
Write a typed idc object to the database.
gts_code_t
Constants to be used with get_size()
Definition typeinf.hpp:2977
@ GTS_NESTED
nested type (embedded into a udt)
Definition typeinf.hpp:2978
@ GTS_BASECLASS
is baseclass of a udt
Definition typeinf.hpp:2979
idaman error_t ida_export unpack_idcobj_from_bv(idc_value_t *obj, const tinfo_t &tif, const bytevec_t &bytes, int pio_flags=0)
Read a typed idc object from the byte vector.
idaman int ida_export guess_tinfo(tinfo_t *out, tid_t id)
Generate a type information about the id from the disassembly.
THREAD_SAFE bool is_type_char(type_t t)
Does the type specify a char value? (signed or unsigned, see Basic type: integer)
Definition typeinf.hpp:496
THREAD_SAFE bool is_type_struct(type_t t)
See BTF_STRUCT.
Definition typeinf.hpp:456
idaman bool ida_export del_til(const char *name)
Unload a til file.
idaman DEPRECATED uint32 ida_export choose_local_tinfo_and_delta(int32 *, const til_t *, const char *, til_tinfo_predicate_t *, uint32, void *)
THREAD_SAFE bool is_type_double(type_t t)
See BTF_DOUBLE.
Definition typeinf.hpp:529
THREAD_SAFE bool is_type_typedef(type_t t)
See BTF_TYPEDEF.
Definition typeinf.hpp:454
const int TYPID_SHIFT
First type detail bit.
Definition typeinf.hpp:3072
ssize_t get_c_header_path(qstring *buf)
Get the include directory path of the target compiler.
Definition typeinf.hpp:2849
void set_c_header_path(const char *incdir)
Set include directory path the target compiler.
Definition typeinf.hpp:2846
bool is_restype_void(const til_t *til, const type_t *type)
Definition typeinf.hpp:696
idaman type_t ida_export get_scalar_bt(size_t size)
THREAD_SAFE bool is_type_ptr_or_array(type_t t)
Is the type a pointer or array type?
Definition typeinf.hpp:510
qvector< regobj_t > regobjvec_t
Definition typeinf.hpp:6131
uint64 bmask64_t
unsigned value that describes a bitmask
Definition typeinf.hpp:103
idaman bool ida_export func_has_stkframe_hole(ea_t ea, const func_type_data_t &fti)
Looks for a hole at the beginning of the stack arguments.
idaman int ida_export lower_type(til_t *til, tinfo_t *tif, const char *name=nullptr, lowertype_helper_t *_helper=nullptr)
Lower type.
THREAD_SAFE bool is_type_uint16(type_t t)
See BTF_UINT16.
Definition typeinf.hpp:524
idaman bool ida_export calc_arglocs(func_type_data_t *fti)
THREAD_SAFE bool is_type_integral(type_t t)
Is the type an integral type (char/short/int/long/bool)?
Definition typeinf.hpp:514
THREAD_SAFE bool is_type_union(type_t t)
See BTF_UNION.
Definition typeinf.hpp:457
THREAD_SAFE bool is_tah_byte(type_t t)
The TAH byte (type attribute header byte) denotes the start of type attributes.
Definition typeinf.hpp:606
THREAD_SAFE bool is_type_bitfld(type_t t)
See BT_BITFIELD.
Definition typeinf.hpp:461
uchar p_string
Inside a type string, a Pascal-like string: dt length, characters.
Definition typeinf.hpp:99
idaman error_t ida_export pack_idcobj_to_bv(const idc_value_t *obj, const tinfo_t &tif, relobj_t *bytes, void *objoff, int pio_flags=0)
Write a typed idc object to the byte vector.
stock_type_id_t
IDs for common types.
Definition typeinf.hpp:2901
@ STI_PINT
int *
Definition typeinf.hpp:2907
@ STI_PCVOID
const void *
Definition typeinf.hpp:2911
@ STI_AEABI_LCMP
int __fastcall __pure(int64 x, int64 y)
Definition typeinf.hpp:2919
@ STI_RTC_CHECK_8
int64 __fastcall(int64 x)
Definition typeinf.hpp:2929
@ STI_SSIZE_T
ssize_t
Definition typeinf.hpp:2923
@ STI_PUNKNOWN
_UNKNOWN *
Definition typeinf.hpp:2932
@ STI_AUCHAR
uint8[]
Definition typeinf.hpp:2913
@ STI_AEABI_MEMSET
void __fastcall(void *, size_t, int)
Definition typeinf.hpp:2925
@ STI_ACHAR
char[]
Definition typeinf.hpp:2912
@ STI_DONT_USE
unused stock type id; should not be used
Definition typeinf.hpp:2921
@ STI_COMPLEX128
struct complex128_t { double real, imag; }
Definition typeinf.hpp:2931
@ STI_PCCHAR
const char *
Definition typeinf.hpp:2904
@ STI_PUINT
unsigned int *
Definition typeinf.hpp:2908
@ STI_ACCHAR
const char[]
Definition typeinf.hpp:2914
@ STI_PCUCHAR
const uint8 *
Definition typeinf.hpp:2905
@ STI_COMPLEX64
struct complex64_t { float real, imag; }
Definition typeinf.hpp:2930
@ STI_RTC_CHECK_2
int16 __fastcall(int16 x)
Definition typeinf.hpp:2927
@ STI_RTC_CHECK_4
int32 __fastcall(int32 x)
Definition typeinf.hpp:2928
@ STI_AEABI_MEMCPY
void __fastcall(void *, const void *, size_t)
Definition typeinf.hpp:2924
@ STI_MSGSEND
void *(void *, const char *, ...)
Definition typeinf.hpp:2918
@ STI_LAST
Definition typeinf.hpp:2933
@ STI_FDELOP
void __cdecl(void *)
Definition typeinf.hpp:2917
@ STI_PVOID
void *
Definition typeinf.hpp:2909
@ STI_PPVOID
void **
Definition typeinf.hpp:2910
@ STI_AEABI_ULCMP
int __fastcall __pure(uint64 x, uint64 y)
Definition typeinf.hpp:2920
@ STI_AEABI_MEMCLR
void __fastcall(void *, size_t)
Definition typeinf.hpp:2926
@ STI_FPURGING
void __userpurge(int)
Definition typeinf.hpp:2916
@ STI_PCHAR
char *
Definition typeinf.hpp:2902
@ STI_PUCHAR
uint8 *
Definition typeinf.hpp:2903
@ STI_ACUCHAR
const uint8[]
Definition typeinf.hpp:2915
@ STI_PBYTE
_BYTE *
Definition typeinf.hpp:2906
@ STI_SIZE_T
size_t
Definition typeinf.hpp:2922
THREAD_SAFE bool is_type_int32(type_t t)
Does the type specify a 32-bit value? (signed or unsigned, see Basic type: integer)
Definition typeinf.hpp:482
THREAD_SAFE bool is_type_uchar(type_t t)
See BTF_UCHAR.
Definition typeinf.hpp:523
THREAD_SAFE bool is_type_floating(type_t t)
Is the type a floating point type?
Definition typeinf.hpp:512
idaman DEPRECATED uint32 ida_export choose_local_tinfo(const til_t *, const char *, til_tinfo_predicate_t *, uint32, void *)
THREAD_SAFE bool is_type_uint(type_t t)
See BTF_UINT.
Definition typeinf.hpp:522
THREAD_SAFE bool is_type_partial(type_t t)
Identifies an unknown or void type with a known size (see Basic type: unknown & void)
Definition typeinf.hpp:444
idaman int ida_export visit_stroff_udms(udm_visitor_t &sfv, const tid_t *path, int plen, adiff_t *disp, bool appzero)
Visit structure fields in a stroff expression or in a reference to a struct data variable.
bool stroff_as_size(int plen, const tinfo_t &tif, asize_t value)
Should display a structure offset expression as the structure size?
Definition typeinf.hpp:5642
qvector< tinfo_t > tinfovec_t
vector of tinfo objects
Definition typeinf.hpp:4633
tinfo_t remove_pointer(const tinfo_t &tif)
BT_PTR: If the current type is a pointer, return the pointed object.
Definition typeinf.hpp:6037
idaman bool ida_export dump_func_type_data(qstring *out, const func_type_data_t &fti, int praloc_bits)
Use func_type_data_t::dump()
const uchar MAX_ENUM_SERIAL
Max number of identical constants allowed for one enum type.
Definition typeinf.hpp:5252
idaman bool ida_export apply_tinfo_to_stkarg(const insn_t &insn, const op_t &x, uval_t v, const tinfo_t &tif, const char *name)
Helper function for the processor modules.
format_functype_t
Function index for the 'format' attribute.
Definition typeinf.hpp:4931
@ FMTFUNC_SCANF
Definition typeinf.hpp:4933
@ FMTFUNC_STRFTIME
Definition typeinf.hpp:4934
@ FMTFUNC_STRFMON
Definition typeinf.hpp:4935
@ FMTFUNC_PRINTF
Definition typeinf.hpp:4932
THREAD_SAFE bool is_type_int(type_t bt)
Does the type_t specify one of the basic types in Basic type: integer?
Definition typeinf.hpp:465
THREAD_SAFE bool is_type_arithmetic(type_t t)
Is the type an arithmetic type? (floating or integral)
Definition typeinf.hpp:518
idaman bool ida_export choose_named_type(til_symbol_t *out_sym, const til_t *root_til, const char *title, int ntf_flags, predicate_t *predicate=nullptr)
Choose a type from a type library.
idaman bool ida_export apply_cdecl(til_t *til, ea_t ea, const char *decl, int flags=0)
Apply the specified type to the address.
const int TYPID_ISREF
Identifies that a type that is a typeref.
Definition typeinf.hpp:3071
THREAD_SAFE bool is_type_const(type_t t)
See BTM_CONST.
Definition typeinf.hpp:432
bool is_restype_struni(const til_t *til, const type_t *type)
Definition typeinf.hpp:706
idaman bool ida_export apply_tinfo(ea_t ea, const tinfo_t &tif, uint32 flags)
Apply the specified type to the specified address.
idaman int ida_export add_base_tils(qstring *errbuf, til_t *ti, const char *tildir, const char *bases, bool gen_events)
Add multiple base tils.
gtd_udt_t
Constants to be used with get_udt_details()
Definition typeinf.hpp:2958
@ GTD_CALC_LAYOUT
calculate udt layout
Definition typeinf.hpp:2959
@ GTD_NO_LAYOUT
don't calculate udt layout please note that udt layout may have been calculated earlier
Definition typeinf.hpp:2960
@ GTD_DEL_BITFLDS
delete udt bitfields
Definition typeinf.hpp:2963
THREAD_SAFE bool is_type_enum(type_t t)
See BTF_ENUM.
Definition typeinf.hpp:459
idaman int ida_export add_til(const char *name, int flags)
Load a til file and add it the database type libraries list.
qvector< funcarg_t > funcargvec_t
vector of function argument objects
Definition typeinf.hpp:4825
THREAD_SAFE bool is_type_complex(type_t t)
See BT_COMPLEX.
Definition typeinf.hpp:450
THREAD_SAFE bool is_type_array(type_t t)
See BT_ARRAY.
Definition typeinf.hpp:452
idaman til_t *ida_export load_til(const char *name, qstring *errbuf, const char *tildir=nullptr)
Load til from a file without adding it to the database list (see also add_til).
THREAD_SAFE void align_size(size_t &cur_tot_size, size_t elem_size, size_t algn)
Get alignment delta for the a structure field.
Definition typeinf.hpp:2677
ssize_t get_c_macros(qstring *buf)
Get predefined macros for the target compiler.
Definition typeinf.hpp:2855
idaman void ida_export gen_use_arg_tinfos(struct argtinfo_helper_t *_this, ea_t caller, func_type_data_t *fti, funcargvec_t *rargs)
Do not call this function directly, use argtinfo_helper_t.
uint64 typid_t
Definition typeinf.hpp:3002
idaman til_t *ida_export load_til_header(const char *tildir, const char *name, qstring *errbuf)
Get human-readable til description.
idaman bool ida_export deref_ptr(ea_t *ptr_ea, const tinfo_t &tif, ea_t *closure_obj=nullptr)
Dereference a pointer.
idaman bool ida_export get_enum_member_expr(qstring *buf, const tinfo_t &tif, int serial, uint64 value)
Return a C expression that can be used to represent an enum member.
abs_t
abstractness of declaration (see h2ti())
Definition typeinf.hpp:2050
@ ABS_YES
Definition typeinf.hpp:2053
@ ABS_NO
Definition typeinf.hpp:2052
@ ABS_UNK
Definition typeinf.hpp:2051
THREAD_SAFE bool is_type_void(type_t t)
See BTF_VOID.
Definition typeinf.hpp:446
update_type_t
See begin_type_updating()
Definition typeinf.hpp:6339
@ UTP_STRUCT
Definition typeinf.hpp:6341
@ UTP_ENUM
Definition typeinf.hpp:6340
THREAD_SAFE bool is_type_ldouble(type_t t)
See BTF_LDOUBLE.
Definition typeinf.hpp:528
idaman bool ida_export get_arg_addrs(eavec_t *out, ea_t caller)
Retrieve argument initialization addresses.
idaman void ida_export free_til(til_t *ti)
Free memory allocated by til.
THREAD_SAFE bool is_type_bool(type_t t)
See BTF_BOOL.
Definition typeinf.hpp:532
idaman bool ida_export compact_til(til_t *ti)
Collect garbage in til.
idaman bool ida_export store_til(til_t *ti, const char *tildir, const char *name)
Store til to a file.
idaman DEPRECATED const type_t *ida_export resolve_typedef(const til_t *til, const type_t *type)
THREAD_SAFE bool is_one_bit_mask(uval_t mask)
Is bitmask one bit?
Definition typeinf.hpp:5726
const size_t BADSIZE
bad type size
Definition typeinf.hpp:2043
sval_t align_stkarg_up(sval_t spoff, int type_align, int slotsize, callcnv_t cc=CM_CC_UNKNOWN)
Definition typeinf.hpp:5773
THREAD_SAFE bool is_type_struni(type_t t)
Is the type a struct or union?
Definition typeinf.hpp:458
size_t get_default_align()
Get default alignment for structure fields.
Definition typeinf.hpp:2668
THREAD_SAFE bool is_type_ext_integral(type_t t)
Is the type an extended integral type? (integral or enum)
Definition typeinf.hpp:516
bool is_restype_struct(const til_t *til, const type_t *type)
Definition typeinf.hpp:711
sclass_t
< storage class
Definition typeinf.hpp:2056
@ SC_EXT
extern
Definition typeinf.hpp:2059
@ SC_FRIEND
friend
Definition typeinf.hpp:2063
@ SC_VIRT
virtual
Definition typeinf.hpp:2064
@ SC_UNK
unknown
Definition typeinf.hpp:2057
@ SC_AUTO
auto
Definition typeinf.hpp:2062
@ SC_TYPE
typedef
Definition typeinf.hpp:2058
@ SC_REG
register
Definition typeinf.hpp:2061
@ SC_STAT
static
Definition typeinf.hpp:2060
THREAD_SAFE bool is_sdacl_byte(type_t t)
Identify an sdacl byte.
Definition typeinf.hpp:621
qvector< valstr_t > valstrvec_t
Definition typeinf.hpp:6580
THREAD_SAFE bool is_type_uint64(type_t t)
See BTF_UINT64.
Definition typeinf.hpp:526
THREAD_SAFE type_t get_type_flags(type_t t)
Get type flags (TYPE_FLAGS_MASK)
Definition typeinf.hpp:436
idaman void ida_export begin_type_updating(update_type_t utp)
Mark the beginning of a large update operation on the types.
THREAD_SAFE bool is_type_paf(type_t t)
Is the type a pointer, array, or function type?
Definition typeinf.hpp:503
THREAD_SAFE bool is_type_tbyte(type_t t)
See BTF_FLOAT.
Definition typeinf.hpp:531
idaman til_t *ida_export get_idati()
Pointer to the local type library - this til is private for each IDB file Functions that accept til_t...
THREAD_SAFE bool operator<(const bytevec_t &v1, const bytevec_t &v2)
Compare two bytevecs with '<'.
Definition typeinf.hpp:632
idaman bool ida_export sort_til(til_t *ti)
Sort til (use after modifying it).
bool is_restype_enum(const til_t *til, const type_t *type)
Definition typeinf.hpp:701
std::function< ssize_t(const struct enum_type_data_t &ei, size_t idx, uint64 value, uint64 bmask)> enum_type_visitor_t
Callback for visit_edms.
Definition typeinf.hpp:6742
THREAD_SAFE bool is_type_uint128(type_t t)
See BTF_UINT128.
Definition typeinf.hpp:527
idaman bool ida_export remove_tinfo_pointer(tinfo_t *tif, const char **pname, const til_t *til=nullptr)
Remove pointer of a type.
gtd_func_t
Constants to be used with get_func_details()
Definition typeinf.hpp:2968
@ GTD_NO_ARGLOCS
don't calculate func arg locations please note that the locations may have been calculated earlier
Definition typeinf.hpp:2970
@ GTD_CALC_ARGLOCS
calculate func arg locations
Definition typeinf.hpp:2969
void set_c_macros(const char *macros)
Set predefined macros for the target compiler.
Definition typeinf.hpp:2852
THREAD_SAFE bool is_type_unknown(type_t t)
See BT_UNKNOWN.
Definition typeinf.hpp:447
idaman void ida_export end_type_updating(update_type_t utp)
Mark the end of a large update operation on the types (see begin_type_updating())
idaman bool ida_export apply_once_tinfo_and_name(ea_t dea, const tinfo_t &tif, const char *name)
Apply the specified type and name to the address.
idaman int ida_export print_decls(text_sink_t &printer, const til_t *til, const ordvec_t *ordinals, uint32 pdf_flags)
Print types (and possibly their dependencies) in a format suitable for using in a header file.
idaman bool ida_export calc_retloc(func_type_data_t *fti)
THREAD_SAFE bool is_type_float(type_t t)
See BTF_FLOAT.
Definition typeinf.hpp:530
idaman bool ida_export apply_callee_tinfo(ea_t caller, const tinfo_t &tif)
Apply the type of the called function to the calling instruction.
THREAD_SAFE bool is_type_ptr(type_t t)
See BT_PTR.
Definition typeinf.hpp:449
idaman int ida_export print_cdata(text_sink_t &printer, const idc_value_t &idc_value, const tinfo_t *tif, const format_data_info_t *fdi=nullptr)
The same as format_cdata(), but instead of returning the answer in a vector, print it.
idaman int ida_export replace_ordinal_typerefs(til_t *til, tinfo_t *tif)
Replace references to ordinal types by name references.
int get_arg_align(int type_align, int slotsize, callcnv_t cc=CM_CC_UNKNOWN)
Definition typeinf.hpp:5751
idaman bool ida_export append_argloc(qtype *out, const argloc_t &vloc)
Serialize argument location.
THREAD_SAFE bool is_type_volatile(type_t t)
See BTM_VOLATILE.
Definition typeinf.hpp:433
idaman type_t ida_export get_realtype(const til_t *til, const type_t *type)
Get the resolved base type.
idaman til_t *ida_export new_til(const char *name, const char *desc)
Initialize a til.
THREAD_SAFE bool is_typeid_last(type_t t)
Is the type_t the last byte of type declaration?
Definition typeinf.hpp:441
idaman bool ida_export format_cdata(qstrvec_t *outvec, const idc_value_t &idc_value, const tinfo_t *tif, valstr_t *vtree=nullptr, const format_data_info_t *fdi=nullptr)
Format a data value as a C initializer.
THREAD_SAFE bool is_type_sue(type_t t)
Is the type a struct/union/enum?
Definition typeinf.hpp:455
idaman bool ida_export calc_varglocs(func_type_data_t *fti, regobjs_t *regs, relobj_t *stkargs, int nfixed)
idaman ssize_t ida_export visit_edms(const tinfo_t &tif, uint64 value, int nbytes, uchar serial, const enum_type_visitor_t &visitor)
Visit enum members having the specified value.
qvector< edm_t > edmvec_t
vector of enum values.
Definition typeinf.hpp:4977
THREAD_SAFE bool is_type_int64(type_t t)
Does the type specify a 64-bit value? (signed or unsigned, see Basic type: integer)
Definition typeinf.hpp:475
idaman DEPRECATED void ida_export build_anon_type_name(qstring *buf, const type_t *type, const p_list *fields)
THREAD_SAFE bool is_type_int128(type_t t)
Does the type specify a 128-bit value? (signed or unsigned, see Basic type: integer)
Definition typeinf.hpp:468
idaman error_t ida_export unpack_idcobj_from_idb(idc_value_t *obj, const tinfo_t &tif, ea_t ea, const bytevec_t *off0, int pio_flags=0)
Collection of register objects.
idaman bool ida_export get_tinfo_by_flags(tinfo_t *out, flags64_t flags)
Get tinfo object that corresponds to data flags.
idaman callcnv_t ida_export guess_func_cc(const func_type_data_t &fti, int npurged, int cc_flags)
Use func_type_data_t::guess_cc()
Additional information about an operand type.
Definition nalt.hpp:1239
This union is used to pass byte values to various helper functions.
Definition ua.hpp:569