IDA C++ SDK 9.2
|
functions to work with named types More...
Topics | |
Flags for named types | |
C/C++ naming flags |
Enumerations | |
enum | tinfo_code_t { TERR_OK = 0 , TERR_SAVE_ERROR = -1 , TERR_SERIALIZE = -2 , TERR_BAD_NAME = -3 , TERR_BAD_ARG = -4 , TERR_BAD_TYPE = -5 , TERR_BAD_SIZE = -6 , TERR_BAD_INDEX = -7 , TERR_BAD_ARRAY = -8 , TERR_BAD_BF = -9 , TERR_BAD_OFFSET = -10 , TERR_BAD_UNIVAR = -11 , TERR_BAD_VARLAST = -12 , TERR_OVERLAP = -13 , TERR_BAD_SUBTYPE = -14 , TERR_BAD_VALUE = -15 , TERR_NO_BMASK = -16 , TERR_BAD_BMASK = -17 , TERR_BAD_MSKVAL = -18 , TERR_BAD_REPR = -19 , TERR_GRP_NOEMPTY = -20 , TERR_DUPNAME = -21 , TERR_UNION_BF = -22 , TERR_BAD_TAH = -23 , TERR_BAD_BASE = -24 , TERR_BAD_GAP = -25 , TERR_NESTED = -26 , TERR_NOT_COMPAT = -27 , TERR_BAD_LAYOUT = -28 , TERR_BAD_GROUPS = -29 , TERR_BAD_SERIAL = -30 , TERR_ALIEN_NAME = -31 , TERR_STOCK = -32 , TERR_ENUM_SIZE = -33 , TERR_NOT_IMPL = -34 , TERR_TYPE_WORSE = -35 , TERR_BAD_FX_SIZE = -36 , TERR_STRUCT_SIZE = -37 , TERR_NOT_FOUND = -38 , TERR_COUNT = 39 } |
Error codes various tinfo functions: More... |
Functions | |
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. | |
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. | |
idaman const char *ida_export | tinfo_errstr (tinfo_code_t code) |
Helper function to convert an error code into a printable string. | |
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 | first_named_type (const til_t *ti, int ntf_flags) |
Enumerate types. | |
idaman const char *ida_export | next_named_type (const til_t *ti, const char *name, int ntf_flags) |
Enumerate types. | |
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. | |
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 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 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. | |
virtual bool | custom_callcnv_t::decorate_name (qstring *outbuf, const char *name, bool should_decorate, callcnv_t cc, const tinfo_t &type) const |
Decorate a function name. |
functions to work with named types
enum tinfo_code_t |
Error codes various tinfo functions:
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.
The returned pointers are pointers to static storage.
They are valid until free_til(), set_named_type(), del_named_type(),
rename_named_type(), set_numbered_type(), del_numbered_type(),
and idb structure/enum manipulation (in other words, until til_t is changed).
ti | pointer to type information library |
name | name of type |
ntf_flags | combination of Flags for named types |
type | ptr to ptr to output buffer for the type info |
fields | ptr to ptr to the field/args names. may be nullptr |
cmt | ptr to ptr to the main comment. may be nullptr the comment may has TPOS_REGCMT as its first byte |
fieldcmts | ptr to ptr to the field/args comments. may be nullptr |
sclass | ptr to storage class |
value | ptr to symbol value. for types, ptr to the ordinal number |
0 | can't find the named type (or name==nullptr) |
1 | ok, the buffers are filled with information (if not nullptr) |
2 | ok, found it in a base til |
|
inline |
See get_named_type() above.
idaman const char *ida_export tinfo_errstr | ( | tinfo_code_t | code | ) |
Helper function to convert an error code into a printable string.
Additional arguments are handled using the functions from err.h
Delete information about a symbol.
ti | type library |
name | name of symbol |
ntf_flags | combination of Flags for named types |
idaman const char *ida_export first_named_type | ( | const til_t * | ti, |
int | ntf_flags ) |
Enumerate types.
ti | type library. nullptr means the local type library for the current database. |
ntf_flags | combination of Flags for named types |
idaman const char *ida_export next_named_type | ( | const til_t * | ti, |
const char * | name, | ||
int | ntf_flags ) |
Enumerate types.
ti | type library. nullptr means the local type library for the current database. |
ntf_flags | combination of Flags for named types |
name | the current name. the name that follows this one will be returned. |
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.
This function will copy the specified type and all dependent types from the source type library to the destination library.
dsttil | Destination til. It must have original types enabled |
srctil | Source til. |
name | name of the type to copy |
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.
out | output buffer |
name | name of symbol |
should_decorate | true-decorate name, false-undecorate |
cc | calling convention |
type | name type (nullptr-unknown) |
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 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.
out | output buffer |
name | original (mangled or decorated) name |
type | name type if known, otherwise nullptr |
ccn_flags | one of C/C++ naming flags |
|
inlinevirtual |
Decorate a function name.
Function to be overloaded for custom calling conventions.
Some compilers decorate names depending on the calling convention. This function provides the means to handle it for custom callcnvs. Please note that this is about name decoration (C), not name mangling (C++).