IDA C++ SDK 9.2
Loading...
Searching...
No Matches
dbg.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2026 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef DBG_HPP
9#define DBG_HPP
10
11#include <idp.hpp>
12#include <idd.hpp>
13#include <kernwin.hpp> // for callui() and ui_notification_t
14
24
25//--------------------------------------------------------------------
26// D E B U G G E R I N F O R M A T I O N
27//--------------------------------------------------------------------
28
34
35//--------------------------------------------------------------------
36// D E B U G G E R C A L L B A C K S
37//--------------------------------------------------------------------
93{
95
96 // debugger low-level event notifications (see IDD.HPP for details).
97
101
105
109
113
115
117
119
121
123
130
131 // debugger high-level event notifications
132
137
146
154
158
159 // debugger asynchronous function result notifications
160 // Please note some low-level event notifications also act as asynchronous
161 // function result notifications.
162
164
166
168
170
174
177
179};
180
184#define BPTEV_ADDED 0
185#define BPTEV_REMOVED 1
186#define BPTEV_CHANGED 2
188
189#ifndef __UI__
190
191//--------------------------------------------------------------------
192// D E B U G G E R F U N C T I O N S
193//--------------------------------------------------------------------
240
249
250inline bool idaapi run_requests(void) { return callui(ui_dbg_run_requests).cnd; }
251
252
257
259
260
262
263inline bool is_request_running(void) { return get_running_request() != ui_null; }
264
265
270
272
273
278
281
282//--------------------------------------------------------------------
283// P R O C E S S C O M M A N D S
284//--------------------------------------------------------------------
290
295
296inline int idaapi get_process_state(void) { return callui(ui_dbg_get_process_state).i; }
297
298#endif // __UI__
299
303#define DSTATE_SUSP -1
304#define DSTATE_NOTASK 0
305#define DSTATE_RUN 1
307inline bool idaapi is_valid_dstate(int state)
308{
309 return state == DSTATE_SUSP || state == DSTATE_NOTASK || state == DSTATE_RUN;
310}
311
315#define DBGINV_MEMORY 0x0001
316#define DBGINV_MEMCFG 0x0002
317#define DBGINV_REGS 0x0004
318#define DBGINV_ALL 0x7FFF
319#define DBGINV_REDRAW 0x8000
320#define DBGINV_NONE 0
322
323#ifndef __UI__
324
341
342inline int idaapi set_process_state(int newstate, thid_t *p_thid, int dbginv) { return callui(ui_dbg_set_process_state, newstate, p_thid, dbginv).i; }
343
344
350
351inline int idaapi invalidate_dbg_state(int dbginv)
352{
353 return set_process_state(DSTATE_NOTASK, nullptr, dbginv);
354}
355
356
370
371inline int idaapi start_process(
372 const char *path = nullptr,
373 const char *args = nullptr,
374 const char *sdir = nullptr)
375{
376 return callui(ui_dbg_start_process, path, args, sdir).i;
377}
378
379
381
382inline int idaapi request_start_process(
383 const char *path = nullptr,
384 const char *args = nullptr,
385 const char *sdir = nullptr)
386{
387 return callui(ui_dbg_request_start_process, path, args, sdir).i;
388}
389
390
406
407inline bool idaapi suspend_process(void) { return callui(ui_dbg_suspend_process).cnd; }
408
410
411inline bool idaapi request_suspend_process(void) { return callui(ui_dbg_request_suspend_process).cnd; }
412
413
423
424inline bool idaapi continue_process(void) { return callui(ui_dbg_continue_process).cnd; }
425
428
429inline bool idaapi request_continue_process(void) { return callui(ui_dbg_request_continue_process).cnd; }
430
441
442inline bool idaapi continue_backwards(void) { return callui(ui_dbg_continue_backwards).cnd; }
443
446
448
452
453inline bool idaapi exit_process(void) { return callui(ui_dbg_exit_process).cnd; }
454
456
457inline bool idaapi request_exit_process(void) { return callui(ui_dbg_request_exit_process).cnd; }
458
459
465
466inline ssize_t idaapi get_processes(procinfo_vec_t *proclist) { return callui(ui_dbg_get_processes, proclist).ssize; }
467
468
483
484inline int idaapi attach_process(pid_t pid=NO_PROCESS, int event_id=-1) { return callui(ui_dbg_attach_process, pid, event_id).i; }
485
487
488inline int idaapi request_attach_process(pid_t pid, int event_id) { return callui(ui_dbg_request_attach_process, pid, event_id).i; }
489
490
494
495inline bool idaapi detach_process(void) { return callui(ui_dbg_detach_process).cnd; }
496
498
499inline bool idaapi request_detach_process(void) { return callui(ui_dbg_request_detach_process).cnd; }
500
501
507
508inline bool idaapi is_debugger_busy(void) { return callui(ui_dbg_is_busy).cnd; }
509
511
512
513//--------------------------------------------------------------------
514// T H R E A D S
515//--------------------------------------------------------------------
521
525
526inline int idaapi get_thread_qty(void) { return callui(ui_dbg_get_thread_qty).i; }
527
528
534
535inline thid_t idaapi getn_thread(int n) { return (thid_t)callui(ui_dbg_getn_thread, n).i; }
536
537
541
543
544
551
552inline const char *idaapi getn_thread_name(int n) { return callui(ui_dbg_getn_thread_name, n).cptr; }
553
554
562
563inline bool idaapi select_thread(thid_t tid) { return callui(ui_dbg_select_thread, tid).cnd; }
564
566
567inline bool idaapi request_select_thread(thid_t tid) { return callui(ui_dbg_request_select_thread, tid).cnd; }
568
569
579
580inline int idaapi suspend_thread(thid_t tid) { return callui(ui_dbg_suspend_thread, tid).i; }
581
583
584inline int idaapi request_suspend_thread(thid_t tid) { return callui(ui_dbg_request_suspend_thread, tid).i; }
585
586
594
595inline int idaapi resume_thread(thid_t tid) { return callui(ui_dbg_resume_thread, tid).i; }
596
598
599inline int idaapi request_resume_thread(thid_t tid) { return callui(ui_dbg_request_resume_thread, tid).i; }
600
602
603
604//--------------------------------------------------------------------
605// M O D U L E S
606//--------------------------------------------------------------------
622inline bool idaapi get_first_module(modinfo_t *modinfo)
623{ return callui(ui_dbg_get_first_module, modinfo).cnd; }
624
625inline bool idaapi get_next_module(modinfo_t *modinfo)
626{ return callui(ui_dbg_get_next_module, modinfo).cnd; }
627
629
630
631//--------------------------------------------------------------------
632// E X E C U T I O N F L O W C O N T R O L C O M M A N D S
633//--------------------------------------------------------------------
639
644
645inline bool idaapi step_into(void) { return callui(ui_dbg_step_into).cnd; }
646
648
649inline bool idaapi request_step_into(void) { return callui(ui_dbg_request_step_into).cnd; }
650
651
657
658inline bool idaapi step_over(void) { return callui(ui_dbg_step_over).cnd; }
659
661
662inline bool idaapi request_step_over(void) { return callui(ui_dbg_request_step_over).cnd; }
663
664
669
670inline bool idaapi step_into_backwards(void) { return callui(ui_dbg_step_into_backwards).cnd; }
671
673
675
676
682
683inline bool idaapi step_over_backwards(void) { return callui(ui_dbg_step_over_backwards).cnd; }
684
686
688
689
701
702inline bool idaapi run_to(ea_t ea, pid_t pid = NO_PROCESS, thid_t tid = NO_THREAD) { return callui(ui_dbg_run_to, ea, pid, tid).cnd; }
703
705
706inline bool idaapi request_run_to(ea_t ea, pid_t pid = NO_PROCESS, thid_t tid = NO_THREAD) { return callui(ui_dbg_request_run_to, ea, pid, tid).cnd; }
707
708
718
719inline bool idaapi run_to_backwards(ea_t ea, pid_t pid = NO_PROCESS, thid_t tid = NO_THREAD) { return callui(ui_dbg_run_to_backwards, ea, pid, tid).cnd; }
720
722
723inline bool idaapi request_run_to_backwards(ea_t ea, pid_t pid = NO_PROCESS, thid_t tid = NO_THREAD) { return callui(ui_dbg_request_run_to_backwards, ea, pid, tid).cnd; }
724
725
731
732inline bool idaapi step_until_ret(void) { return callui(ui_dbg_step_until_ret).cnd; }
733
735
736inline bool idaapi request_step_until_ret(void) { return callui(ui_dbg_request_step_until_ret).cnd; }
737
738
741
742inline bool idaapi set_resume_mode(thid_t tid, resume_mode_t mode) { return callui(ui_dbg_set_resume_mode, tid, mode).cnd; }
743
745
746inline bool idaapi request_set_resume_mode(thid_t tid, resume_mode_t mode) { return callui(ui_dbg_request_set_resume_mode, tid, mode).cnd; }
747
749
750
751//--------------------------------------------------------------------
752// R E G I S T E R S
753//--------------------------------------------------------------------
769
773
774inline bool idaapi get_dbg_reg_info(const char *regname, register_info_t *ri) { return callui(ui_dbg_get_reg_info, regname, ri).cnd; }
775
779
780inline bool idaapi get_reg_val(const char *regname, regval_t *regval) { return callui(ui_dbg_get_reg_val, regname, regval).cnd; }
781
783
784inline bool idaapi get_reg_val(const char *regname, uint64 *ival) { return callui(ui_dbg_get_reg_val_i, regname, ival).cnd; }
785
786
789inline bool idaapi get_sp_val(ea_t *out) { return callui(ui_dbg_get_sp_val, out).cnd; }
790
793inline bool idaapi get_ip_val(ea_t *out) { return callui(ui_dbg_get_ip_val, out).cnd; }
794
798
799inline bool idaapi set_reg_val(const char *regname, const regval_t *regval) { return callui(ui_dbg_set_reg_val, regname, regval).cnd; }
800
802
803inline bool idaapi set_reg_val(const char *regname, uint64 ival) { return callui(ui_dbg_set_reg_val_i, regname, ival).cnd; }
804
806
807inline bool idaapi request_set_reg_val(const char *regname, const regval_t *regval) { return callui(ui_dbg_request_set_reg_val, regname, regval).cnd; }
808
809
813
814inline bool idaapi is_reg_integer(const char *regname) { return callui(ui_dbg_get_reg_value_type, regname).i-2 == RVT_INT; }
815
816
820
821inline bool idaapi is_reg_float(const char *regname) { return callui(ui_dbg_get_reg_value_type, regname).i-2 == RVT_FLOAT; }
822
823
827
828inline bool idaapi is_reg_custom(const char *regname) { return callui(ui_dbg_get_reg_value_type, regname).i >= 2; }
829
831
832#endif // __UI__
833
834//--------------------------------------------------------------------
835// B R E A K P O I N T S
836//--------------------------------------------------------------------
842
843int idaapi set_bptloc_string(const char *s);
844const char *idaapi get_bptloc_string(int i);
845
846struct bpt_t;
847struct bpt_location_t;
848struct movbpt_info_t;
853
862
863struct bptaddrs_t : public eavec_t
864{
865 bpt_t *bpt; // bpt described by this structure.
866 // we need it to handle internal srcbpts
867};
868
870
871
872
873#ifdef __UI__
874// use direct call to compare_bpt_locs() in case of UI (otherwise will have
875// "Bad event detected during undo" for ui_dbg_compare_bpt_locs)
876idaman int ida_export compare_bpt_locs(const bpt_location_t &a, const bpt_location_t &b);
877#endif
878
888
891{
892// private:
894 int index;
896// public:
897 bpt_loctype_t type(void) const { return loctype; }
898 bool is_empty_path(void) const { return index == 0; }
899 const char *path(void) const { return get_bptloc_string(index); }
900 const char *symbol(void) const { return get_bptloc_string(index); }
901 int lineno(void) const { return int(info); }
902 uval_t offset(void) const { return (uval_t)info; }
903 ea_t ea(void) const { return info; }
904
905 bpt_location_t(void) : info(BADADDR), index(0), loctype(BPLT_ABS) {}
906
908 bool valid() const { return loctype != BPLT_ABS || info != BADADDR; }
909
912 {
913 info = a;
915 }
916
918 void set_src_bpt(const char *fn, int _lineno)
919 {
921 info = _lineno;
923 }
924
926 void set_sym_bpt(const char *_symbol, uval_t _offset=0)
927 {
928 index = set_bptloc_string(_symbol);
929 info = _offset;
931 }
932
934 void set_rel_bpt(const char *mod, uval_t _offset)
935 {
937 info = _offset;
939 }
940
946#ifdef __UI__
947 int compare(const bpt_location_t &r) const { return compare_bpt_locs(*this, r); }
948#else
949 int compare(const bpt_location_t &r) const { return callui(ui_dbg_compare_bpt_locs, this, &r).i; }
950#endif
951 bool operator==(const bpt_location_t &r) const { return compare(r) == 0; }
952 bool operator!=(const bpt_location_t &r) const { return compare(r) != 0; }
953 bool operator< (const bpt_location_t &r) const { return compare(r) < 0; }
954 bool operator> (const bpt_location_t &r) const { return compare(r) > 0; }
955 bool operator<=(const bpt_location_t &r) const { return compare(r) <= 0; }
956 bool operator>=(const bpt_location_t &r) const { return compare(r) >= 0; }
957
959 size_t print(qstring *buf) const;
960};
962
964struct bpt_t
965{
966 size_t cb;
979#define BPT_BRK 0x001
980#define BPT_TRACE 0x002
981#define BPT_UPDMEM 0x004
982#define BPT_ENABLED 0x008
983#define BPT_LOWCND 0x010
984#define BPT_TRACEON 0x020
985#define BPT_TRACE_INSN 0x040
986#define BPT_TRACE_FUNC 0x080
987#define BPT_TRACE_BBLK 0x100
988#define BPT_TRACE_TYPES (BPT_TRACE_INSN|BPT_TRACE_FUNC|BPT_TRACE_BBLK)
992#define BPT_ELANG_MASK 0xF0000000u
993#define BPT_ELANG_SHIFT 28
995
996 uint32 props;
1000#define BKPT_BADBPT 0x01
1001#define BKPT_LISTBPT 0x02
1002#define BKPT_TRACE 0x04
1003#define BKPT_ACTIVE 0x08
1004#define BKPT_PARTIAL 0x10
1005#define BKPT_CNDREADY 0x20
1006#define BKPT_FAKEPEND 0x40
1008#define BKPT_PAGE 0x80
1011
1012 int size;
1016 bpt_t(void) : cb(sizeof(*this)), pid(NO_PROCESS), tid(NO_THREAD), ea(BADADDR),
1017 type(BPT_SOFT), pass_count(0), flags(BPT_BRK|BPT_ENABLED),
1018 props(0), size(0), cndidx(-1), bptid(0) {}
1019
1020 bool is_hwbpt(void) const { return type != BPT_SOFT; }
1021 bool enabled(void) const { return (flags & BPT_ENABLED) != 0; }
1022 bool is_low_level(void) const { return (flags & BPT_LOWCND) != 0; }
1023 bool badbpt(void) const { return (props & BKPT_BADBPT) != 0; }
1024 bool listbpt(void) const { return (props & BKPT_LISTBPT) != 0; }
1025 bool is_compiled(void) const { return (props & BKPT_CNDREADY) != 0; }
1026 /// Written completely to process?
1027 bool is_active(void) const { return (props & (BKPT_PARTIAL|BKPT_ACTIVE)) == BKPT_ACTIVE; }
1029 bool is_partially_active(void) const { return (props & BKPT_PARTIAL) != 0; }
1031 bool is_inactive(void) const { return (props & (BKPT_PARTIAL|BKPT_ACTIVE)) == 0; }
1033 bool is_page_bpt(void) const { return (props & BKPT_PAGE) != 0; }
1036 int get_size(void) const { return is_hwbpt() ? size : 1; }
1038 void set_abs_bpt(ea_t a) { loc.set_abs_bpt(a); ea = a; }
1040 void set_src_bpt(const char *fn, int lineno) { loc.set_src_bpt(fn, lineno); ea = BADADDR; }
1042 void set_sym_bpt(const char *sym, uval_t o) { loc.set_sym_bpt(sym, o); ea = BADADDR; }
1044 void set_rel_bpt(const char *mod, uval_t o) { loc.set_rel_bpt(mod, o); ea = BADADDR; }
1046 bool is_absbpt(void) const { return loc.type() == BPLT_ABS; }
1047 bool is_relbpt(void) const { return loc.type() == BPLT_REL; }
1048 bool is_symbpt(void) const { return loc.type() == BPLT_SYM; }
1049 bool is_srcbpt(void) const { return loc.type() == BPLT_SRC; }
1052 bool is_tracemodebpt(void) const { return (flags & BPT_TRACE_TYPES) != 0; }
1054 bool is_traceonbpt(void) const { return is_tracemodebpt() && (flags & BPT_TRACEON) != 0; }
1056 bool is_traceoffbpt(void) const { return is_tracemodebpt() && (flags & BPT_TRACEON) == 0; }
1058 bool set_trace_action(bool enable, int trace_types)
1060 trace_types &= BPT_TRACE_TYPES;
1061 if ( trace_types == 0 )
1062 return false;
1063 flags |= trace_types;
1064 setflag(flags, BPT_TRACEON, enable);
1065 return true;
1066 }
1067
1068
1069 const char *get_cnd_elang() const;
1070
1073 bool set_cnd_elang(const char *name);
1074
1075 size_t get_cnd_elang_idx() const { return flags >> BPT_ELANG_SHIFT; }
1077 void set_cond(const char *cnd);
1078 bool eval_cond(ea_t ea, bool *fire, const char *bpt_type);
1081
1088
1089#ifndef __UI__
1090
1091
1095
1096inline int idaapi get_bpt_qty(void) { return callui(ui_dbg_get_bpt_qty).i; }
1097
1098
1105
1106inline bool idaapi getn_bpt(int n, bpt_t *bpt) { return callui(ui_dbg_getn_bpt, n, bpt).cnd; }
1107
1108
1115
1116inline bool idaapi get_bpt(ea_t ea, bpt_t *bpt) { return callui(ui_dbg_get_bpt, ea, bpt).cnd; }
1117
1118
1120
1121inline bool exist_bpt(ea_t ea) { return get_bpt(ea, nullptr); }
1122
1123
1141
1142inline bool idaapi add_bpt(ea_t ea, asize_t size = 0, bpttype_t type = BPT_DEFAULT) { return callui(ui_dbg_add_oldbpt, ea, size, type).cnd; }
1143
1145
1147
1148
1155
1156inline bool idaapi add_bpt(const bpt_t &bpt) { return callui(ui_dbg_add_bpt, &bpt).cnd; }
1157
1159
1160inline bool idaapi request_add_bpt(const bpt_t &bpt) { return callui(ui_dbg_request_add_bpt, &bpt).cnd; }
1161
1162
1167
1168inline bool idaapi del_bpt(ea_t ea) { return callui(ui_dbg_del_oldbpt, ea).cnd; }
1169
1171
1172inline bool idaapi request_del_bpt(ea_t ea) { return callui(ui_dbg_request_del_oldbpt, ea).cnd; }
1173
1174
1179
1180inline bool idaapi del_bpt(const bpt_location_t &bptloc) { return callui(ui_dbg_del_bpt, &bptloc).cnd; }
1181
1183
1184inline bool idaapi request_del_bpt(const bpt_location_t &bptloc) { return callui(ui_dbg_request_del_bpt, &bptloc).cnd; }
1185
1186
1208
1209inline bool idaapi update_bpt(const bpt_t *bpt) { return callui(ui_dbg_update_bpt, bpt).cnd; }
1210
1211
1217
1218inline bool idaapi find_bpt(const bpt_location_t &bptloc, bpt_t *bpt) { return callui(ui_dbg_find_bpt, &bptloc, bpt).cnd; }
1219
1220
1226
1227inline int idaapi change_bptlocs(
1228 const movbpt_infos_t &movinfo,
1229 movbpt_codes_t *codes = nullptr,
1230 bool del_hindering_bpts = true)
1231{
1232 return callui(ui_dbg_change_bptlocs, &movinfo, codes, del_hindering_bpts).i;
1233}
1234
1235
1242inline bool idaapi enable_bpt(ea_t ea, bool enable = true) { return callui(ui_dbg_enable_oldbpt, ea, enable).cnd; }
1243inline bool idaapi enable_bpt(const bpt_location_t &bptloc, bool enable = true) { return callui(ui_dbg_enable_bpt, &bptloc, enable).cnd; }
1244inline bool disable_bpt(ea_t ea) { return enable_bpt(ea, false); }
1245inline bool disable_bpt(const bpt_location_t &bptloc) { return enable_bpt(bptloc, false); }
1246inline bool idaapi request_enable_bpt(ea_t ea, bool enable = true) { return callui(ui_dbg_request_enable_oldbpt, ea, enable).cnd; }
1247inline bool idaapi request_enable_bpt(const bpt_location_t &bptloc, bool enable = true) { return callui(ui_dbg_request_enable_bpt, &bptloc, enable).cnd; }
1248inline bool request_disable_bpt(ea_t ea) { return request_enable_bpt(ea, false); }
1249inline bool request_disable_bpt(const bpt_location_t &bptloc) { return request_enable_bpt(bptloc, false); }
1251
1252
1255
1256inline int idaapi check_bpt(ea_t ea) { return callui(ui_dbg_check_bpt, ea).i; }
1257
1258#endif // __UI__
1259
1263#define BPTCK_NONE -1
1264#define BPTCK_NO 0
1265#define BPTCK_YES 1
1266#define BPTCK_ACT 2
1268
1269#ifndef SWIG
1275{
1277 const char *name;
1278 bpt_visitor_t(void) : range(0, BADADDR), name(nullptr) {}
1280 virtual int idaapi visit_bpt(const bpt_t *bpt) = 0;
1281 int idaapi for_all_bpts(int bvflags)
1282 {
1283 return callui(ui_dbg_for_all_bpts, this, bvflags).i;
1284 }
1285};
1286
1292#define BVF_ABS 0x0001
1293#define BVF_REL 0x0002
1294#define BVF_SYM 0x0004
1295#define BVF_SRC 0x0008
1296#define BVF_ALL 0x000F
1297#define BVF_STATE 0x0030
1298#define BVFS_ANY 0x0000
1299#define BVFS_INPROC 0x0010
1300#define BVFS_PENDING 0x0020
1301#define BVFS_DISABLED 0x0030
1303#endif // SWIG
1304
1305
1307
1308
1309#ifndef __UI__
1310
1315
1316//--------------------------------------------------------------------
1317// T R A C I N G B U F F E R
1318//--------------------------------------------------------------------
1326
1327
1335
1336inline bool idaapi set_trace_size(int size) { return callui(ui_dbg_set_trace_size, size).cnd; }
1337
1338
1342
1343inline void idaapi clear_trace(void) { callui(ui_dbg_clear_trace); }
1344
1346
1348
1350
1351
1352//--------------------------------------------------------------------
1353// S T E P T R A C I N G
1354//--------------------------------------------------------------------
1364
1368
1369inline bool idaapi is_step_trace_enabled(void) { return callui(ui_dbg_is_step_trace_enabled).cnd; }
1370
1371
1383
1384inline bool idaapi enable_step_trace(int enable = 1) { return callui(ui_dbg_enable_step_trace, enable).cnd; }
1385inline bool disable_step_trace(void) { return enable_step_trace(0); }
1386inline bool idaapi request_enable_step_trace(int enable = 1) { return callui(ui_dbg_request_enable_step_trace, enable).cnd; }
1387inline bool request_disable_step_trace(void) { return request_enable_step_trace(false); }
1389
1390#endif // __UI__
1391
1392
1396#define ST_OVER_DEBUG_SEG 0x01
1397#define ST_OVER_LIB_FUNC 0x02
1398#define ST_ALREADY_LOGGED 0x04
1399#define ST_SKIP_LOOPS 0x08
1400#define ST_DIFFERENTIAL 0x10
1402#define ST_OPTIONS_MASK (ST_OVER_DEBUG_SEG|ST_OVER_LIB_FUNC|ST_ALREADY_LOGGED|ST_SKIP_LOOPS|ST_DIFFERENTIAL)
1403#define ST_OPTIONS_DEFAULT (ST_OVER_DEBUG_SEG|ST_OVER_LIB_FUNC)
1405
1407#define IT_LOG_SAME_IP 0x01
1409#define FT_LOG_RET 0x01
1411#define BT_LOG_INSTS 0x01
1412
1413#ifndef __UI__
1414
1419
1421
1425
1426inline void idaapi set_step_trace_options(int options) { callui(ui_dbg_set_step_trace_options, options); }
1427
1429
1431
1433
1434
1435//--------------------------------------------------------------------
1436// I N S T R U C T I O N S T R A C I N G
1437//--------------------------------------------------------------------
1446
1450
1451inline bool idaapi is_insn_trace_enabled(void) { return callui(ui_dbg_is_insn_trace_enabled).cnd; }
1452
1457inline bool idaapi enable_insn_trace(bool enable = true) { return callui(ui_dbg_enable_insn_trace, enable).cnd; }
1458inline bool disable_insn_trace(void) { return enable_insn_trace(false); }
1459inline bool idaapi request_enable_insn_trace(bool enable = true) { return callui(ui_dbg_request_enable_insn_trace, enable).cnd; }
1460inline bool request_disable_insn_trace(void) { return request_enable_insn_trace(false); }
1462
1463
1468
1470
1471
1475
1476inline void idaapi set_insn_trace_options(int options) { callui(ui_dbg_set_insn_trace_options, options); }
1477
1479
1481
1483
1484
1485//--------------------------------------------------------------------
1486// F U N C T I O N S T R A C I N G
1487//--------------------------------------------------------------------
1494
1498
1499inline bool idaapi is_func_trace_enabled(void) { return callui(ui_dbg_is_func_trace_enabled).cnd; }
1500
1501
1506inline bool idaapi enable_func_trace(bool enable = true) { return callui(ui_dbg_enable_func_trace, enable).cnd; }
1507inline bool disable_func_trace(void) { return enable_func_trace(false); }
1508inline bool idaapi request_enable_func_trace(bool enable = true) { return callui(ui_dbg_request_enable_func_trace, enable).cnd; }
1509inline bool request_disable_func_trace(void) { return request_enable_func_trace(false); }
1511
1512
1517
1519
1520
1524
1525inline void idaapi set_func_trace_options(int options) { callui(ui_dbg_set_func_trace_options, options); }
1526
1528
1530
1532
1533
1534//--------------------------------------------------------------------
1535// B A S I C B L O C K T R A C I N G
1536//--------------------------------------------------------------------
1540
1541// Modify basic block tracing options.
1542// Type: Synchronous function - available as Request
1543// Notification: none (synchronous function)
1544
1545
1550inline bool idaapi enable_bblk_trace(bool enable = true) { return callui(ui_dbg_enable_bblk_trace, enable).cnd; }
1551inline bool disable_bblk_trace(void) { return enable_bblk_trace(false); }
1552inline bool idaapi request_enable_bblk_trace(bool enable = true) { return callui(ui_dbg_request_enable_bblk_trace, enable).cnd; }
1553inline bool request_disable_bblk_trace(void) { return request_enable_bblk_trace(false); }
1554inline bool idaapi is_bblk_trace_enabled(void) { return callui(ui_dbg_is_bblk_trace_enabled).cnd; }
1556
1561
1563
1564
1566
1567inline void idaapi set_bblk_trace_options(int options) { callui(ui_dbg_set_bblk_trace_options, options); }
1568
1570
1572
1574
1575#endif // __UI__
1576
1577//--------------------------------------------------------------------
1578// T R A C I N G E V E N T S
1579//--------------------------------------------------------------------
1583
1596
1598
1607
1608
1617
1618
1619#ifndef __UI__
1620
1624
1625inline int idaapi get_tev_qty(void) { return callui(ui_dbg_get_tev_qty).i; }
1626
1627
1635
1636inline bool idaapi get_tev_info(int n, tev_info_t *tev_info) { return callui(ui_dbg_get_tev_info, n, tev_info).cnd; }
1637
1638
1649
1650inline bool idaapi get_insn_tev_reg_val(int n, const char *regname, regval_t *regval) { return callui(ui_dbg_get_insn_tev_reg_val, n, regname, regval).cnd; }
1651
1652inline bool idaapi get_insn_tev_reg_val(int n, const char *regname, uint64 *ival) { return callui(ui_dbg_get_insn_tev_reg_val_i, n, regname, ival).cnd; }
1653
1654
1662
1663inline bool idaapi get_insn_tev_reg_mem(int n, memreg_infos_t *memmap) { return callui(ui_dbg_get_insn_tev_reg_mem, n, memmap).cnd; }
1664
1665
1674
1675inline bool idaapi get_insn_tev_reg_result(int n, const char *regname, regval_t *regval) { return callui(ui_dbg_get_insn_tev_reg_result, n, regname, regval).cnd; }
1676
1677inline bool idaapi get_insn_tev_reg_result(int n, const char *regname, uint64 *ival) { return callui(ui_dbg_get_insn_tev_reg_result_i, n, regname, ival).cnd; }
1678
1679
1686
1687inline ea_t idaapi get_call_tev_callee(int n) { ea_t ea; callui(ui_dbg_get_call_tev_callee, n, &ea); return ea; }
1688
1689
1696
1697inline ea_t idaapi get_ret_tev_return(int n) { ea_t ea; callui(ui_dbg_get_ret_tev_return, n, &ea); return ea; }
1698
1699
1711
1712inline ea_t idaapi get_bpt_tev_ea(int n) { ea_t ea; callui(ui_dbg_get_bpt_tev_ea, n, &ea); return ea; }
1713
1714
1723
1724inline bool idaapi get_tev_memory_info(int n, meminfo_vec_t *mi) { return callui(ui_dbg_get_tev_memory_info, n, mi).cnd; }
1725
1726
1735
1736inline bool idaapi get_tev_event(int n, debug_event_t *d) { return callui(ui_dbg_get_tev_event, n, d).cnd; }
1737
1738
1743
1744inline ea_t idaapi get_trace_base_address(void) { ea_t ea; callui(ui_dbg_get_trace_base_address, &ea); return ea; }
1745
1746
1750
1752
1753
1757
1758inline void idaapi dbg_add_thread(thid_t tid) { callui(ui_dbg_add_thread, tid); }
1759
1760
1764
1765inline void idaapi dbg_del_thread(thid_t tid) { callui(ui_dbg_del_thread, tid); }
1766
1767
1771
1772inline void idaapi dbg_add_tev(tev_type_t type, thid_t tid, ea_t address) { callui(ui_dbg_add_tev, type, tid, address); }
1773
1774#endif // __UI__
1775
1778{
1781
1782 tev_reg_value_t(int _reg_idx = -1, uint64 _value = uint64(-1)) : reg_idx(_reg_idx)
1783 {
1784 value._set_int(_value);
1785 }
1786};
1789
1798
1799
1807
1808#ifndef __UI__
1809
1814
1815inline bool idaapi dbg_add_many_tevs(tevinforeg_vec_t *new_tevs) { return callui(ui_dbg_add_many_tevs, new_tevs).cnd; }
1816
1817
1822
1823inline bool idaapi dbg_add_insn_tev(thid_t tid, ea_t ea, save_reg_values_t save = SAVE_DIFF) { return callui(ui_dbg_add_insn_tev, tid, ea, save).cnd; }
1824
1825
1830
1831inline bool idaapi dbg_add_bpt_tev(thid_t tid, ea_t ea, ea_t bp) { return callui(ui_dbg_add_bpt_tev, tid, ea, bp).cnd; }
1832
1833
1837
1838inline void idaapi dbg_add_call_tev(thid_t tid, ea_t caller, ea_t callee) { callui(ui_dbg_add_call_tev, tid, caller, callee); }
1839
1840
1844
1845inline void idaapi dbg_add_ret_tev(thid_t tid, ea_t ret_insn, ea_t return_to) { callui(ui_dbg_add_ret_tev, tid, ret_insn, return_to); }
1846
1847
1851
1853
1855
1856
1857//---------------------------------------------------------------------------
1858// Trace management functions
1859//---------------------------------------------------------------------------
1863
1867
1868inline bool idaapi load_trace_file(qstring *buf, const char *filename) { return callui(ui_dbg_load_trace_file, buf, filename).cnd; }
1869
1870
1872
1873inline bool idaapi save_trace_file(const char *filename, const char *description) { return callui(ui_dbg_save_trace_file, filename, description).cnd; }
1874
1875
1877
1878inline bool idaapi is_valid_trace_file(const char *filename) { return callui(ui_dbg_is_valid_trace_file, filename).cnd; }
1879
1880
1882
1883inline bool idaapi set_trace_file_desc(const char *filename, const char *description) { return callui(ui_dbg_set_trace_file_desc, filename, description).cnd; }
1884
1885
1887
1888inline bool idaapi get_trace_file_desc(qstring *buf, const char *filename) { return callui(ui_dbg_get_trace_file_desc, buf, filename).cnd; }
1889
1890
1892
1893inline bool idaapi choose_trace_file(qstring *buf) { return callui(ui_dbg_choose_trace_file, buf).cnd; }
1894
1895
1897
1898inline bool idaapi diff_trace_file(const char *NONNULL filename) { return callui(ui_dbg_diff_trace_file, filename).cnd; }
1899
1900
1902
1903inline bool idaapi graph_trace(void) { return callui(ui_dbg_graph_trace).cnd; }
1904
1905
1907
1909 bool hilight,
1910 bgcolor_t color,
1911 bgcolor_t diff)
1912{
1913 callui(ui_dbg_set_highlight_trace_options, hilight, color, diff);
1914}
1915
1916
1918
1919inline void idaapi set_trace_platform(const char *platform) { callui(ui_dbg_set_trace_platform, platform); }
1920
1921
1923
1924inline const char *idaapi get_trace_platform() { return callui(ui_dbg_get_trace_platform).cptr; }
1925
1926
1928
1930
1931
1933
1935
1937
1938#endif // __UI__
1939
1940//---------------------------------------------------------------------------
1941// High level functions (usable from scripts)
1942//--------------------------------------------------------------------
1948
1952
1960
1964#define WFNE_ANY 0x0001
1965#define WFNE_SUSP 0x0002
1966#define WFNE_SILENT 0x0004
1967#define WFNE_CONT 0x0008
1968#define WFNE_NOWAIT 0x0010
1970#define WFNE_USEC 0x0020
1973
1977#define DOPT_SEGM_MSGS 0x00000001
1978#define DOPT_START_BPT 0x00000002
1979#define DOPT_THREAD_MSGS 0x00000004
1980#define DOPT_THREAD_BPT 0x00000008
1981#define DOPT_BPT_MSGS 0x00000010
1982//#define DOPT_BINS_BPT 0x00000020 // break on breakpoint instruction
1983#define DOPT_LIB_MSGS 0x00000040
1984#define DOPT_LIB_BPT 0x00000080
1985#define DOPT_INFO_MSGS 0x00000100
1986#define DOPT_INFO_BPT 0x00000200
1987#define DOPT_REAL_MEMORY 0x00000400
1988#define DOPT_REDO_STACK 0x00000800
1989#define DOPT_ENTRY_BPT 0x00001000
1990#define DOPT_EXCDLG 0x00006000
1991# define EXCDLG_NEVER 0x00000000
1992# define EXCDLG_UNKNOWN 0x00002000
1993# define EXCDLG_ALWAYS 0x00006000
1994#define DOPT_LOAD_DINFO 0x00008000
1995#define DOPT_END_BPT 0x00010000
1996#define DOPT_TEMP_HWBPT 0x00020000
1997#define DOPT_FAST_STEP 0x00040000
1998#define DOPT_DISABLE_ASLR 0x00080000
2000#ifndef __UI__
2001
2010
2011inline dbg_event_code_t idaapi wait_for_next_event(int wfne, int timeout) { return dbg_event_code_t(callui(ui_dbg_wait_for_next_event, wfne, timeout).i); }
2012
2013
2015
2016inline const debug_event_t *idaapi get_debug_event(void) { return (const debug_event_t *)callui(ui_dbg_get_debug_event).vptr; }
2017
2018
2022
2023inline uint idaapi set_debugger_options(uint options) { return callui(ui_dbg_set_debugger_options, options).i; }
2024
2025
2032
2033inline void idaapi set_remote_debugger(const char *host, const char *pass, int port=-1) { callui(ui_dbg_set_remote_debugger, host, pass, port); }
2034
2035
2038
2039inline void idaapi get_process_options(
2040 qstring *path,
2041 qstring *args,
2042 launch_env_t *out_envs,
2043 qstring *sdir,
2044 qstring *host,
2045 qstring *pass,
2046 int *port)
2047{
2048 callui(ui_dbg_get_process_options, path, args, sdir, host, pass, port, out_envs);
2049}
2050
2051
2054
2055inline void idaapi set_process_options(
2056 const char *path,
2057 const char *args,
2058 const launch_env_t *envs,
2059 const char *sdir,
2060 const char *host,
2061 const char *pass,
2062 int port)
2063{
2064 callui(ui_dbg_set_process_options, path, args, sdir, host, pass, port, envs);
2065}
2066
2067
2072
2074
2075
2078
2079inline bool idaapi store_exceptions(void) { return callui(ui_dbg_store_exceptions).cnd; }
2080
2081
2089
2090inline const char *idaapi define_exception(uint code, const char *name, const char *desc, int flags) { return callui(ui_dbg_define_exception, code, name, desc, flags).cptr; }
2091
2092#endif // __UI__
2093
2094
2095//--------------------------------------------------------------------
2096
2098
2099inline THREAD_SAFE bool have_set_options(const debugger_t *_dbg)
2100{
2101 return _dbg != nullptr && _dbg->have_set_options();
2102}
2103
2106
2107inline const char *idaapi set_dbg_options(
2108 debugger_t *_dbg,
2109 const char *keyword,
2110 int pri,
2111 int value_type,
2112 const void *value)
2113{
2114 const char *res = IDPOPT_BADKEY;
2115 if ( have_set_options(_dbg) )
2116 _dbg->set_dbg_options(&res, keyword, pri, value_type, value);
2117 return res;
2118}
2119
2120
2121inline const char *idaapi set_dbg_default_options(
2122 debugger_t *_dbg,
2123 const char *keyword,
2124 int value_type,
2125 const void *value)
2126{
2127 return set_dbg_options(_dbg, keyword, IDPOPT_PRI_DEFAULT, value_type, value);
2128}
2129
2130inline const char *idaapi set_int_dbg_options(
2131 debugger_t *_dbg,
2132 const char *keyword,
2133 int32 value)
2134{
2135 sval_t sv = value;
2136 return set_dbg_default_options(_dbg, keyword, IDPOPT_NUM, &sv);
2137}
2138
2139#ifndef __KERNEL__
2141
2142inline const char *idaapi set_dbg_options(
2143 const char *keyword,
2144 int pri,
2145 int value_type,
2146 const void *value)
2147{
2148 return set_dbg_options(dbg, keyword, pri, value_type, value);
2149}
2150
2152
2153inline const char *idaapi set_dbg_default_options(
2154 const char *keyword,
2155 int value_type,
2156 const void *value)
2157{
2158 return set_dbg_options(keyword, IDPOPT_PRI_DEFAULT, value_type, value);
2159}
2160
2162
2163inline const char *idaapi set_int_dbg_options(
2164 const char *keyword,
2165 int32 value)
2166{
2167 sval_t sv = value;
2168 return set_dbg_default_options(keyword, IDPOPT_NUM, &sv);
2169}
2170#endif // __KERNEL__
2171
2173
2174//---------------------------------------------------------------------------
2175// S O U R C E I N F O R M A T I O N P R O V I D E R S
2176//---------------------------------------------------------------------------
2190
2191class srcinfo_provider_t;
2192
2193class idc_value_t;
2194class rangeset_t;
2195class source_item_t;
2196class argloc_t;
2197
2206
2207//--------------------------------------------------------------------------
2213
2215{
2216 int size_cb;
2217public:
2218 eval_ctx_t(ea_t _ea) : size_cb(sizeof(*this)), ea(_ea) {}
2220};
2221
2222
2223#ifndef __UI__
2224class TWidget;
2225#endif
2226
2227//--------------------------------------------------------------------------
2230{
2231public:
2233 virtual void idaapi release() override = 0;
2234
2237 virtual srcinfo_provider_t *idaapi get_provider(void) const = 0;
2238
2241 virtual const char *idaapi get_path(qstring *errbuf) = 0;
2242
2247 virtual TWidget *open_srcview(strvec_t **strvec, TWidget **pview, int lnnum, int colnum) = 0;
2248
2252 virtual bool idaapi read_file(strvec_t *buf, qstring *errbuf) = 0;
2253};
2254
2261
2262//--------------------------------------------------------------------------
2278
2279//--------------------------------------------------------------------------
2282{
2283public:
2285 virtual void idaapi release() override = 0;
2286
2289
2291 virtual bool idaapi get_name(qstring *buf) const = 0;
2292
2294 virtual int idaapi get_lnnum() const = 0;
2295
2299 virtual int idaapi get_end_lnnum() const = 0;
2300
2303 virtual int idaapi get_colnum() const = 0;
2304
2309 virtual int idaapi get_end_colnum() const = 0;
2310
2312 virtual ea_t idaapi get_ea() const = 0;
2313
2319 virtual asize_t idaapi get_size() const = 0;
2320
2324 virtual bool idaapi get_item_bounds(rangeset_t *set) const = 0;
2325
2330 virtual source_item_ptr idaapi get_parent(src_item_kind_t max_kind) const = 0;
2331
2334
2339 virtual bool idaapi get_hint(
2340 qstring *hint,
2341 const eval_ctx_t *ctx,
2342 int *nlines) const = 0;
2343
2348 virtual bool idaapi evaluate(
2349 const eval_ctx_t *ctx,
2350 idc_value_t *res,
2351 qstring *errbuf) const = 0;
2352
2363 virtual bool idaapi equals(const source_item_t *other) const = 0;
2364
2370
2372 virtual src_item_kind_t idaapi get_item_kind(const eval_ctx_t * /*ctx*/) const newapi { return SRCIT_NONE; }
2374 bool is_stmt(const eval_ctx_t *ctx) const { return get_item_kind(ctx) == SRCIT_STMT; }
2376 bool is_module(const eval_ctx_t *ctx) const { return get_item_kind(ctx) == SRCIT_MODULE; }
2378 bool is_func(const eval_ctx_t *ctx) const { return get_item_kind(ctx) == SRCIT_FUNC; }
2380 bool is_expr(const eval_ctx_t *ctx) const { return get_item_kind(ctx) >= SRCIT_EXPR; }
2382 bool is_locvar(const eval_ctx_t *ctx) const { return get_item_kind(ctx) >= SRCIT_LOCVAR; }
2384 bool is_sttvar(const eval_ctx_t *ctx) const { return get_item_kind(ctx) == SRCIT_STTVAR; }
2385
2388 virtual srcinfo_provider_t *idaapi get_provider(void) const = 0;
2389
2391 virtual bool idaapi get_location(argloc_t * /*out*/, const eval_ctx_t * /*ctx*/) const newapi { return false; }
2392
2394 virtual bool idaapi get_expr_tinfo(tinfo_t *tif) const = 0;
2396};
2397
2398#define SRCDBG_PROV_VERSION 4
2399
2400//--------------------------------------------------------------------------
2403{
2404public:
2406 size_t cb;
2407
2413#define SPF_DECOMPILER 0x0001
2414#define SPF_ENABLED 0x0002
2416#define SPF_ACTIVE 0x0004
2418#define SPF_VERSION_MASK 0xFF000000
2421
2423 const char *name;
2424
2426 const char *display_name;
2427
2428 srcinfo_provider_t(const char *_name, const char *_display_name, int _flags=0)
2429 : cb(sizeof(*this)), flags(_flags), name(_name), display_name(_display_name)
2430 {
2431 flags |= SRCDBG_PROV_VERSION << 24;
2432 }
2433
2435 bool is_decompiler(void) const { return (flags & SPF_DECOMPILER) != 0; }
2437 bool is_enabled(void) const { return (flags & SPF_ENABLED) != 0; }
2439 bool is_active(void) const { return (flags & SPF_ACTIVE) != 0; }
2440
2442 uint8 get_version() const { return (flags >> 24) & 0xFF; }
2443
2446 virtual bool idaapi enable_provider(bool enable) = 0;
2447
2454 virtual const char *idaapi set_options(
2455 const char *keyword,
2456 int value_type,
2457 const void *value) = 0;
2458
2462 virtual void idaapi add_module(const char *path, ea_t base, asize_t size) = 0;
2463
2465 virtual void idaapi del_module(ea_t base) = 0;
2466
2470 virtual void idaapi get_ready(void) = 0;
2471
2476 virtual int idaapi get_change_flags(void) = 0;
2480#define SPCH_NONE 0x0000
2481#define SPCH_FILES 0x0001
2482#define SPCH_ITEMS 0x0002
2483#define SPCH_LINES 0x0004
2485
2498 ea_t ea,
2499 asize_t size,
2500 src_item_kind_t level,
2501 bool may_decompile) = 0;
2502
2506 virtual source_item_iterator idaapi find_source_items(source_file_t *sf, int lnnum, int colnum=0) = 0;
2507
2510 virtual source_file_iterator idaapi create_file_iterator(const char *filename=nullptr) = 0;
2511
2514
2517 virtual bool idaapi apply_module_info(const char * /*path*/) { return false; }
2518
2523 virtual source_item_ptr idaapi find_static_item(const char *name, ea_t ea) = 0;
2524};
2525
2526
2527//--------------------------------------------------------------------------
2532
2534
2535
2538
2540
2541
2542#ifndef __UI__
2543class source_view_t;
2544
2546
2547inline source_view_t *create_source_viewer(
2548 TWidget **out_ccv,
2549 TWidget *parent,
2550 TWidget *custview,
2551 source_file_ptr sf,
2552 strvec_t *lines,
2553 int lnnum,
2554 int colnum,
2555 int flags)
2556{
2557 return (source_view_t *) callui(
2558 ui_create_source_viewer, out_ccv, parent, custview, &sf,
2559 lines, lnnum, colnum, flags).vptr;
2560}
2561
2562#endif
2563
2564//--------------------------------------------------------------------------
2571
2572idaman bool ida_export get_dbg_byte(uint32 *out, ea_t ea);
2573
2574
2579
2580idaman bool ida_export put_dbg_byte(ea_t ea, uint32 x);
2581
2583
2584//--------------------------------------------------------------------------
2585// D E B U G G E R M E M O R Y F U N C T I O N S F O R U I
2586//--------------------------------------------------------------------------
2592
2605
2606idaman void ida_export set_dbgmem_source(
2607 range_t *(idaapi*dbg_get_memory_config)(int *n),
2608 int (idaapi*memory_read)(ea_t ea, void *buffer, int size),
2609 int (idaapi*memory_write)(ea_t ea, const void *buffer, int size));
2610
2611
2615
2616idaman void ida_export invalidate_dbgmem_config(void);
2617
2618
2623
2624idaman void ida_export invalidate_dbgmem_contents(ea_t ea, asize_t size);
2625
2626
2628
2629idaman bool ida_export is_debugger_on(void);
2630
2631
2633
2634idaman bool ida_export is_debugger_memory(ea_t ea);
2635
2637
2638//------------------------------------------------------------------------
2639#if !defined(__UI__) && !defined(__KERNEL__) // Not for the UI nor the kernel
2640
2641
2647inline ea_t idaapi get_tev_ea(int n) { ea_t ea; callui(ui_dbg_get_tev_ea, n, &ea); return ea; }
2648inline int idaapi get_tev_type(int n) { return callui(ui_dbg_get_tev_type, n).i; }
2649inline int idaapi get_tev_tid(int n) { return callui(ui_dbg_get_tev_tid, n).i; }
2651inline void idaapi get_manual_regions(meminfo_vec_t *ranges) { callui(ui_dbg_get_manual_regions, ranges); }
2652inline void idaapi set_manual_regions(const meminfo_vec_t *ranges) { callui(ui_dbg_set_manual_regions, ranges); }
2654inline void idaapi enable_manual_regions(bool enable) { callui(ui_dbg_enable_manual_regions, enable); }
2655inline int idaapi handle_debug_event(const debug_event_t *ev, int rqflags) { return callui(ui_dbg_handle_debug_event, ev, rqflags).i; }
2656inline bool idaapi add_virt_module(const modinfo_t *mod) { return callui(ui_dbg_add_vmod, mod).cnd; }
2657inline bool idaapi del_virt_module(const ea_t base) { return callui(ui_dbg_del_vmod, base).cnd; }
2658inline int idaapi set_bptloc_string(const char *s) { return callui(ui_dbg_set_bptloc_string, s).i; }
2659inline const char *idaapi get_bptloc_string(int i) { return callui(ui_dbg_get_bptloc_string, i).cptr; }
2660inline int idaapi internal_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value) { return callui(ui_dbg_internal_get_sreg_base, answer, tid, sreg_value).i; }
2661inline int idaapi internal_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize) { return callui(ui_dbg_internal_ioctl, fn, buf, size, poutbuf, poutsize).i; }
2662inline int idaapi get_reg_vals(thid_t tid, int clsmask, regval_t *values) { return callui(ui_dbg_read_registers, tid, clsmask, values).i; }
2663inline int idaapi set_reg_val(thid_t tid, int regidx, const regval_t *value) { return callui(ui_dbg_write_register, tid, regidx, value).i; }
2664inline int idaapi get_dbg_memory_info(meminfo_vec_t *ranges) { return callui(ui_dbg_get_memory_info, ranges).i; }
2665
2673inline bool idaapi set_bpt_group(bpt_t &bpt, const char *grp_name) { return callui(ui_dbg_set_bpt_group, &bpt, grp_name).cnd; }
2674
2683inline bool idaapi set_bptloc_group(const bpt_location_t &bptloc, const char *grp_name) { return callui(ui_dbg_set_bptloc_group, &bptloc, grp_name).cnd; }
2684
2693inline bool idaapi get_bpt_group(qstring *grp_name, const bpt_location_t &bptloc) { return callui(ui_dbg_get_bpt_group, grp_name, &bptloc).cnd; }
2694
2700inline size_t idaapi list_bptgrps(qstrvec_t *bptgrps) { return callui(ui_dbg_list_bptgrps, bptgrps).ssize; }
2701
2708inline bool idaapi rename_bptgrp(const char *old_name, const char *new_name) { return callui(ui_dbg_rename_bptgrp, old_name, new_name).cnd; }
2709
2715inline bool idaapi del_bptgrp(const char *name) { return callui(ui_dbg_del_bptgrp, name).cnd; }
2716
2723inline ssize_t idaapi get_grp_bpts(bpt_vec_t *bpts, const char *grp_name) { return callui(ui_dbg_get_grp_bpts, bpts, grp_name).ssize; }
2724
2733inline int idaapi enable_bptgrp(const char *bptgrp_name, bool enable=true) { return callui(ui_dbg_enable_bptgrp, bptgrp_name, enable).i; }
2734inline bool idaapi get_local_vars(srcinfo_provider_t *prov, ea_t ea, source_items_t *out) { return callui(ui_dbg_get_local_vars, prov, ea, out).cnd; }
2735inline bool idaapi srcdbg_request_step_into(void) { return callui(ui_dbg_srcdbg_request_step_into).cnd; }
2736inline bool idaapi srcdbg_request_step_over(void) { return callui(ui_dbg_srcdbg_request_step_over).cnd; }
2739#endif // !__UI__ && !__KERNEL__
2740
2741// These are needed by the kernel, and need to go through the UI
2742#ifndef __UI__
2744inline int idaapi hide_all_bpts(void) { return callui(ui_dbg_hide_all_bpts).i; }
2745inline ssize_t idaapi read_dbg_memory(ea_t ea, void *buffer, size_t size) { return callui(ui_dbg_read_memory, ea, buffer, size).ssize; }
2746inline bool idaapi get_module_info(ea_t ea, modinfo_t *modinfo) { return callui(ui_dbg_get_module_info, ea, modinfo).cnd; }
2747inline drc_t idaapi dbg_bin_search(ea_t *out, ea_t start_ea, ea_t end_ea, const compiled_binpat_vec_t &data, int srch_flags, qstring *errbuf)
2748 { return drc_t(callui(ui_dbg_bin_search, out, start_ea, end_ea, &data, srch_flags, errbuf).i); }
2749inline bool idaapi dbg_can_query(debugger_t *_dbg)
2750{
2751 // Debugger can be queried iif it is set and either currently in
2752 // suspended state, or can be queried while not in suspended state
2753 return _dbg != nullptr && (_dbg->may_disturb() || get_process_state() < DSTATE_NOTASK);
2754}
2755inline bool idaapi dbg_can_query(void)
2756{
2757 return dbg_can_query(dbg);
2758}
2759inline bool idaapi load_debugger(const char *dbgname, bool use_remote) { return callui(ui_dbg_load_debugger, dbgname, use_remote).cnd; }
2760inline bool idaapi collect_stack_trace(thid_t tid, call_stack_t *trace) { return callui(ui_dbg_collect_stack_trace, tid, trace).cnd; }
2761inline bool idaapi get_global_var(srcinfo_provider_t *prov, ea_t ea, const char *name, source_item_ptr *out) { return callui(ui_dbg_get_global_var, prov, ea, name, out).cnd; }
2762inline bool idaapi get_local_var(srcinfo_provider_t *prov, ea_t ea, const char *name, source_item_ptr *out) { return callui(ui_dbg_get_local_var, prov, ea, name, out).cnd; }
2763inline srcinfo_provider_t *idaapi get_srcinfo_provider(const char *name) { return (srcinfo_provider_t *)callui(ui_dbg_get_srcinfo_provider, name).vptr; }
2764inline bool idaapi get_current_source_file(qstring *out) { return callui(ui_dbg_get_current_source_file, out).cnd; }
2766inline void idaapi add_path_mapping(const char *src, const char *dst) { callui(ui_dbg_add_path_mapping, src, dst); }
2767inline bool idaapi srcdbg_step_into(void) { return callui(ui_dbg_srcdbg_step_into).cnd; }
2768inline bool idaapi srcdbg_step_over(void) { return callui(ui_dbg_srcdbg_step_over).cnd; }
2769inline bool idaapi srcdbg_step_until_ret(void) { return callui(ui_dbg_srcdbg_step_until_ret).cnd; }
2770inline ssize_t idaapi write_dbg_memory(ea_t ea, const void *buffer, size_t size) { return callui(ui_dbg_write_memory, ea, buffer, size).ssize; }
2771inline void idaapi set_debugger_event_cond(const char *NONNULL evcond) { callui(ui_dbg_set_event_cond, evcond); }
2772inline const char *idaapi get_debugger_event_cond(void) { return callui(ui_dbg_get_event_cond).cptr; }
2773inline const char *bpt_t::get_cnd_elang() const { return (const char *)(callui(ui_dbg_internal_get_elang, this).cptr); }
2774inline bool bpt_t::set_cnd_elang(const char *name) { return callui(ui_dbg_internal_set_elang, this, name).cnd; }
2775#endif // !__UI__
2776
2777
2778// internal kernel functions to lock the debugger memory configuration updates
2779// Do not use these functions! They will be removed!
2780idaman void ida_export lock_dbgmem_config(void);
2781idaman void ida_export unlock_dbgmem_config(void);
2782
2783
2785{
2786private:
2787 size_t cb = sizeof(dbg_deref_options_t);
2788public:
2791};
2792
2793
2794#endif
qvector< compiled_binpat_t > compiled_binpat_vec_t
Definition bytes.hpp:2370
Describes an argument location.
Definition typeinf.hpp:1105
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
Execution context.
Definition dbg.hpp:2215
ea_t ea
Definition dbg.hpp:2219
eval_ctx_t(ea_t _ea)
Definition dbg.hpp:2218
Class to hold idc values.
Definition expr.hpp:315
Interface class for iterator types.
Definition pro.h:3060
qrefcnt_obj_t(void)
Constructor.
Definition pro.h:3048
Smart pointer to objects derived from qrefcnt_obj_t.
Definition pro.h:2996
Reimplementation of vector class from STL.
Definition pro.h:2262
Describes a source file.
Definition dbg.hpp:2230
virtual bool idaapi read_file(strvec_t *buf, qstring *errbuf)=0
Read entire file (colored lines).
virtual TWidget * open_srcview(strvec_t **strvec, TWidget **pview, int lnnum, int colnum)=0
Open window with source code (optional function).
virtual srcinfo_provider_t *idaapi get_provider(void) const =0
Get source info provider.
virtual const char *idaapi get_path(qstring *errbuf)=0
Get path to the source file (or a symbolic name).
virtual void idaapi release() override=0
Call this function to free source_file_t.
Describes a subdivision of source information.
Definition dbg.hpp:2282
virtual bool idaapi equals(const source_item_t *other) const =0
Do these two items have the same source?
virtual bool idaapi get_hint(qstring *hint, const eval_ctx_t *ctx, int *nlines) const =0
Calculate a string to display as a hint.
virtual source_file_iterator idaapi get_source_files()=0
Get source files of the item.
bool is_stmt(const eval_ctx_t *ctx) const
Does this source item represent a statement?
Definition dbg.hpp:2374
virtual void idaapi release() override=0
Call this function to free source_item_t.
virtual int idaapi get_lnnum() const =0
Get line number of the item (1-based)
virtual int idaapi get_end_colnum() const =0
Get ending column number.
virtual bool idaapi get_name(qstring *buf) const =0
Get name of the item.
bool is_func(const eval_ctx_t *ctx) const
Does this source item represent a function?
Definition dbg.hpp:2378
virtual bool idaapi get_location(argloc_t *, const eval_ctx_t *) const newapi
Get the location for this source item.
Definition dbg.hpp:2391
virtual int idaapi get_colnum() const =0
Get column number of the item.
virtual bool idaapi get_expr_tinfo(tinfo_t *tif) const =0
Get expression type.
bool is_expr(const eval_ctx_t *ctx) const
Does this source item represent an expression?
Definition dbg.hpp:2380
bool is_sttvar(const eval_ctx_t *ctx) const
Does this source item represent a static variable or code?
Definition dbg.hpp:2384
bool is_module(const eval_ctx_t *ctx) const
Does this source item represent a module?
Definition dbg.hpp:2376
virtual source_item_ptr idaapi get_parent(src_item_kind_t max_kind) const =0
Get parent of the item.
bool is_locvar(const eval_ctx_t *ctx) const
Does this source item represent a stack, register, or register-relative local variable or parameter?
Definition dbg.hpp:2382
virtual source_item_iterator idaapi create_children_iterator()=0
Create an iterator to enumerate all children of the item.
virtual bool idaapi evaluate(const eval_ctx_t *ctx, idc_value_t *res, qstring *errbuf) const =0
Evaluate item value (meaningful only for expression items).
virtual bool idaapi get_item_bounds(rangeset_t *set) const =0
Get item boundaries as a set of ranges.
virtual src_item_kind_t idaapi get_item_kind(const eval_ctx_t *) const newapi
Get item kind.
Definition dbg.hpp:2372
virtual ea_t idaapi get_ea() const =0
Get starting address of the item.
virtual asize_t idaapi get_size() const =0
Get size of the item in bytes.
virtual int idaapi get_end_lnnum() const =0
Get ending line number (1-based.) The returned line number is the next line after the expression.
virtual srcinfo_provider_t *idaapi get_provider(void) const =0
Get source info provider.
Describes the mechanism used to retrieve source file information.
Definition dbg.hpp:2403
virtual const char *idaapi set_options(const char *keyword, int value_type, const void *value)=0
Configure srcinfo provider.
virtual source_item_ptr idaapi find_static_item(const char *name, ea_t ea)=0
Locate a global variable by its name.
int flags
Source info provider property bits
Definition dbg.hpp:2409
size_t cb
size of this class
Definition dbg.hpp:2406
virtual bool idaapi enable_provider(bool enable)=0
Enable or disable the provider.
virtual source_item_iterator idaapi find_source_items(source_file_t *sf, int lnnum, int colnum=0)=0
Locate source item by a position in a source file.
const char * name
internal (unique) name of srcinfo provider
Definition dbg.hpp:2423
virtual int idaapi get_change_flags(void)=0
Ask the provider if the source information has changed and the screen should be refreshed.
virtual source_item_iterator idaapi create_item_iterator(const source_file_t *sf)=0
Create iterators to enumerate items.
bool is_active(void) const
Is the provider willing to work with the current idb?
Definition dbg.hpp:2439
const char * display_name
external (displayable) name of srcinfo provider
Definition dbg.hpp:2426
bool is_decompiler(void) const
Is the source info provider a decompiler?
Definition dbg.hpp:2435
bool is_enabled(void) const
Has the provider been enabled by the user?
Definition dbg.hpp:2437
virtual void idaapi del_module(ea_t base)=0
Inform the provider that a module got unloaded.
srcinfo_provider_t(const char *_name, const char *_display_name, int _flags=0)
Definition dbg.hpp:2428
virtual void idaapi add_module(const char *path, ea_t base, asize_t size)=0
Inform the provider that a module got loaded.
virtual source_file_iterator idaapi create_file_iterator(const char *filename=nullptr)=0
Create iterators to enumerate files.
virtual void idaapi get_ready(void)=0
Inform the provider that we will request for information now.
virtual bool idaapi apply_module_info(const char *)
Apply the debug information (types, functions, globals) from the module whose path is 'path',...
Definition dbg.hpp:2517
virtual source_item_iterator idaapi find_source_items(ea_t ea, asize_t size, src_item_kind_t level, bool may_decompile)=0
Locate source item by address.
uint8 get_version() const
See SPF_VERSION_MASK.
Definition dbg.hpp:2442
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
idaman debugger_t ida_export_data * dbg
This structure contains information about the current debugger.
Definition dbg.hpp:33
bool idaapi get_global_var(srcinfo_provider_t *prov, ea_t ea, const char *name, source_item_ptr *out)
Definition dbg.hpp:2761
bool idaapi load_debugger(const char *dbgname, bool use_remote)
Definition dbg.hpp:2759
bool idaapi get_current_source_file(qstring *out)
Definition dbg.hpp:2764
int idaapi get_current_source_line(void)
Definition dbg.hpp:2765
bool idaapi srcdbg_step_into(void)
Definition dbg.hpp:2767
const char *idaapi get_debugger_event_cond(void)
Definition dbg.hpp:2772
void idaapi set_debugger_event_cond(const char *NONNULL evcond)
Definition dbg.hpp:2771
bool idaapi srcdbg_step_until_ret(void)
Definition dbg.hpp:2769
idaman void ida_export unlock_dbgmem_config(void)
void idaapi add_path_mapping(const char *src, const char *dst)
Definition dbg.hpp:2766
bool idaapi get_module_info(ea_t ea, modinfo_t *modinfo)
Definition dbg.hpp:2746
bool idaapi get_local_var(srcinfo_provider_t *prov, ea_t ea, const char *name, source_item_ptr *out)
Definition dbg.hpp:2762
bool idaapi srcdbg_step_over(void)
Definition dbg.hpp:2768
ssize_t idaapi write_dbg_memory(ea_t ea, const void *buffer, size_t size)
Definition dbg.hpp:2770
ssize_t idaapi read_dbg_memory(ea_t ea, void *buffer, size_t size)
Definition dbg.hpp:2745
int idaapi internal_cleanup_appcall(thid_t tid)
Definition dbg.hpp:2743
dbg_notification_t
Debugger notification codes.
Definition dbg.hpp:93
@ dbg_bpt
A user defined breakpoint was reached.
Definition dbg.hpp:138
@ dbg_started_loading_bpts
Started loading breakpoint info from idb.
Definition dbg.hpp:175
@ dbg_last
The last debugger notification code.
Definition dbg.hpp:178
@ dbg_run_to
Definition dbg.hpp:167
@ dbg_thread_start
Definition dbg.hpp:114
@ dbg_step_into
Definition dbg.hpp:163
@ dbg_step_until_ret
Definition dbg.hpp:169
@ dbg_information
Definition dbg.hpp:122
@ dbg_process_exit
Definition dbg.hpp:102
@ dbg_finished_loading_bpts
Finished loading breakpoint info from idb.
Definition dbg.hpp:176
@ dbg_process_detach
Definition dbg.hpp:110
@ dbg_null
Definition dbg.hpp:94
@ dbg_suspend_process
The process is now suspended.
Definition dbg.hpp:133
@ dbg_process_start
Definition dbg.hpp:98
@ dbg_thread_exit
Definition dbg.hpp:116
@ dbg_exception
Definition dbg.hpp:124
@ dbg_trace
A step occurred (one instruction was executed).
Definition dbg.hpp:147
@ dbg_library_unload
Definition dbg.hpp:120
@ dbg_bpt_changed
Breakpoint has been changed.
Definition dbg.hpp:171
@ dbg_step_over
Definition dbg.hpp:165
@ dbg_request_error
An error occurred during the processing of a request.
Definition dbg.hpp:155
@ dbg_process_attach
Definition dbg.hpp:106
@ dbg_library_load
Definition dbg.hpp:118
int idaapi hide_all_bpts(void)
Definition dbg.hpp:2744
idaman void ida_export lock_dbgmem_config(void)
bool idaapi dbg_can_query(void)
Definition dbg.hpp:2755
srcinfo_provider_t *idaapi get_srcinfo_provider(const char *name)
Definition dbg.hpp:2763
bool idaapi collect_stack_trace(thid_t tid, call_stack_t *trace)
Definition dbg.hpp:2760
drc_t idaapi dbg_bin_search(ea_t *out, ea_t start_ea, ea_t end_ea, const compiled_binpat_vec_t &data, int srch_flags, qstring *errbuf)
Definition dbg.hpp:2747
const bpttype_t BPT_SOFT
Software breakpoint.
Definition idd.hpp:524
const bpttype_t BPT_DEFAULT
Choose bpt type automatically.
Definition idd.hpp:526
bool idaapi request_del_bpt(ea_t ea)
Post a del_bpt(ea_t) request.
Definition dbg.hpp:1172
int idaapi check_bpt(ea_t ea)
Check the breakpoint at the specified address.
Definition dbg.hpp:1256
bool idaapi add_bpt(ea_t ea, asize_t size=0, bpttype_t type=BPT_DEFAULT)
Add a new breakpoint in the debugged process.
Definition dbg.hpp:1142
int idaapi change_bptlocs(const movbpt_infos_t &movinfo, movbpt_codes_t *codes=nullptr, bool del_hindering_bpts=true)
Move breakpoint(s) from one location to another.
Definition dbg.hpp:1227
qvector< const bpt_t * > bpt_constptr_vec_t
Definition dbg.hpp:850
bool idaapi del_bpt(ea_t ea)
Delete an existing breakpoint in the debugged process.
Definition dbg.hpp:1168
const char *idaapi get_bptloc_string(int i)
Definition dbg.hpp:2659
qvector< movbpt_code_t > movbpt_codes_t
Definition dbg.hpp:861
bool exist_bpt(ea_t ea)
Does a breakpoint exist at the given location?
Definition dbg.hpp:1121
bool idaapi enable_bpt(ea_t ea, bool enable=true)
Definition dbg.hpp:1242
qvector< bpt_t * > bptptr_vec_t
Definition dbg.hpp:851
qvector< bptaddrs_t > bpteas_t
Definition dbg.hpp:869
idaman int ida_export compare_bpt_locs(const bpt_location_t &a, const bpt_location_t &b)
bool disable_bpt(ea_t ea)
Definition dbg.hpp:1244
bool idaapi get_bpt(ea_t ea, bpt_t *bpt)
Get the characteristics of a breakpoint.
Definition dbg.hpp:1116
qvector< movbpt_info_t > movbpt_infos_t
Definition dbg.hpp:849
qvector< bpt_t > bpt_vec_t
vector of breakpoints
Definition dbg.hpp:852
bool request_disable_bpt(ea_t ea)
Definition dbg.hpp:1248
int idaapi set_bptloc_string(const char *s)
Definition dbg.hpp:2658
int idaapi get_bpt_qty(void)
Get number of breakpoints.
Definition dbg.hpp:1096
bool idaapi getn_bpt(int n, bpt_t *bpt)
Get the characteristics of a breakpoint.
Definition dbg.hpp:1106
DECLARE_TYPE_AS_MOVABLE(bpt_location_t)
bool idaapi update_bpt(const bpt_t *bpt)
Update modifiable characteristics of an existing breakpoint.
Definition dbg.hpp:1209
bool idaapi find_bpt(const bpt_location_t &bptloc, bpt_t *bpt)
Find a breakpoint by location.
Definition dbg.hpp:1218
bool idaapi request_add_bpt(ea_t ea, asize_t size=0, bpttype_t type=BPT_DEFAULT)
Post an add_bpt(ea_t, asize_t, bpttype_t) request.
Definition dbg.hpp:1146
movbpt_code_t
Definition dbg.hpp:855
bpt_loctype_t
Breakpoint location types.
Definition dbg.hpp:881
bool idaapi request_enable_bpt(ea_t ea, bool enable=true)
Definition dbg.hpp:1246
@ MOVBPT_DEST_BUSY
destination location is busy (we already have such a bpt)
Definition dbg.hpp:858
@ MOVBPT_BAD_TYPE
BPLT_ABS is not supported.
Definition dbg.hpp:859
@ MOVBPT_NOT_FOUND
source bpt not found
Definition dbg.hpp:857
@ MOVBPT_OK
moved ok
Definition dbg.hpp:856
@ BPLT_REL
relative address: module_path, offset
Definition dbg.hpp:883
@ BPLT_LAST
Definition dbg.hpp:886
@ BPLT_ABS
absolute address: ea
Definition dbg.hpp:882
@ BPLT_SRC
source level: filename, lineno
Definition dbg.hpp:885
@ BPLT_SYM
symbolic: symbol_name, offset
Definition dbg.hpp:884
int idaapi invalidate_dbg_state(int dbginv)
Invalidate cached debugger information.
Definition dbg.hpp:351
bool idaapi request_exit_process(void)
Post an exit_process() request.
Definition dbg.hpp:457
bool idaapi request_suspend_process(void)
Post a suspend_process() request.
Definition dbg.hpp:411
bool idaapi request_detach_process(void)
Post a detach_process() request.
Definition dbg.hpp:499
bool idaapi exit_process(void)
Terminate the debugging of the current process.
Definition dbg.hpp:453
bool idaapi is_valid_dstate(int state)
Definition dbg.hpp:307
bool idaapi request_continue_process(void)
Post a continue_process() request.
Definition dbg.hpp:429
int idaapi request_attach_process(pid_t pid, int event_id)
Post an attach_process() request.
Definition dbg.hpp:488
int idaapi get_process_state(void)
Return the state of the currently debugged process.
Definition dbg.hpp:296
int idaapi set_process_state(int newstate, thid_t *p_thid, int dbginv)
Set new state for the debugged process.
Definition dbg.hpp:342
int idaapi attach_process(pid_t pid=NO_PROCESS, int event_id=-1)
Attach the debugger to a running process.
Definition dbg.hpp:484
bool idaapi continue_process(void)
Continue the execution of the process in the debugger.
Definition dbg.hpp:424
bool idaapi detach_process(void)
Detach the debugger from the debugged process.
Definition dbg.hpp:495
int idaapi request_start_process(const char *path=nullptr, const char *args=nullptr, const char *sdir=nullptr)
Post a start_process() request.
Definition dbg.hpp:382
int idaapi start_process(const char *path=nullptr, const char *args=nullptr, const char *sdir=nullptr)
Start a process in the debugger.
Definition dbg.hpp:371
bool idaapi continue_backwards(void)
Continue the execution of the process in the debugger backwards.
Definition dbg.hpp:442
ssize_t idaapi get_processes(procinfo_vec_t *proclist)
Take a snapshot of running processes and return their description.
Definition dbg.hpp:466
bool idaapi is_debugger_busy(void)
Is the debugger busy?
Definition dbg.hpp:508
bool idaapi request_continue_backwards(void)
Post a continue_backwards() request.
Definition dbg.hpp:447
bool idaapi suspend_process(void)
Suspend the process in the debugger.
Definition dbg.hpp:407
void idaapi bring_debugger_to_front(void)
Definition dbg.hpp:2650
int idaapi enable_bptgrp(const char *bptgrp_name, bool enable=true)
Enable (or disable) all bpts in a folder.
Definition dbg.hpp:2733
bool idaapi srcdbg_request_step_until_ret(void)
Definition dbg.hpp:2737
int idaapi get_reg_vals(thid_t tid, int clsmask, regval_t *values)
Definition dbg.hpp:2662
ea_t idaapi get_tev_ea(int n)
Definition dbg.hpp:2647
bool idaapi get_bpt_group(qstring *grp_name, const bpt_location_t &bptloc)
Retrieve the absolute path to the folder of the bpt based on the bpt_location find_bpt is called to r...
Definition dbg.hpp:2693
int idaapi internal_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize)
Definition dbg.hpp:2661
int idaapi get_dbg_memory_info(meminfo_vec_t *ranges)
Definition dbg.hpp:2664
bool idaapi add_virt_module(const modinfo_t *mod)
Definition dbg.hpp:2656
bool idaapi del_bptgrp(const char *name)
Delete a folder, bpt that were part of this folder are moved to the root folder.
Definition dbg.hpp:2715
void idaapi get_manual_regions(meminfo_vec_t *ranges)
Definition dbg.hpp:2651
void idaapi enable_manual_regions(bool enable)
Definition dbg.hpp:2654
int idaapi get_tev_type(int n)
Definition dbg.hpp:2648
bool idaapi set_bpt_group(bpt_t &bpt, const char *grp_name)
Move a bpt into a folder in the breakpoint dirtree if the folder didn't exists, it will be created.
Definition dbg.hpp:2673
void idaapi edit_manual_regions()
Definition dbg.hpp:2653
ssize_t idaapi get_grp_bpts(bpt_vec_t *bpts, const char *grp_name)
Retrieve a copy of the bpts stored in a folder.
Definition dbg.hpp:2723
bool idaapi get_local_vars(srcinfo_provider_t *prov, ea_t ea, source_items_t *out)
Definition dbg.hpp:2734
bool idaapi del_virt_module(const ea_t base)
Definition dbg.hpp:2657
bool idaapi srcdbg_request_step_over(void)
Definition dbg.hpp:2736
int idaapi handle_debug_event(const debug_event_t *ev, int rqflags)
Definition dbg.hpp:2655
int idaapi get_tev_tid(int n)
Definition dbg.hpp:2649
size_t idaapi list_bptgrps(qstrvec_t *bptgrps)
Retrieve the list of absolute path of all folders of bpt dirtree.
Definition dbg.hpp:2700
bool idaapi set_bptloc_group(const bpt_location_t &bptloc, const char *grp_name)
Move a bpt into a folder in the breakpoint dirtree based on the bpt_location find_bpt is called to re...
Definition dbg.hpp:2683
int idaapi internal_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value)
Definition dbg.hpp:2660
bool idaapi rename_bptgrp(const char *old_name, const char *new_name)
Rename a folder of bpt dirtree.
Definition dbg.hpp:2708
void idaapi set_manual_regions(const meminfo_vec_t *ranges)
Definition dbg.hpp:2652
bool idaapi srcdbg_request_step_into(void)
Definition dbg.hpp:2735
bool idaapi run_to(ea_t ea, pid_t pid=NO_PROCESS, thid_t tid=NO_THREAD)
Execute the process until the given address is reached.
Definition dbg.hpp:702
bool idaapi request_step_over(void)
Post a step_over() request.
Definition dbg.hpp:662
bool idaapi step_into(void)
Execute one instruction in the current thread.
Definition dbg.hpp:645
bool idaapi request_run_to(ea_t ea, pid_t pid=NO_PROCESS, thid_t tid=NO_THREAD)
Post a run_to() request.
Definition dbg.hpp:706
bool idaapi request_step_into(void)
Post a step_into() request.
Definition dbg.hpp:649
bool idaapi step_until_ret(void)
Execute instructions in the current thread until a function return instruction is executed (aka "step...
Definition dbg.hpp:732
bool idaapi set_resume_mode(thid_t tid, resume_mode_t mode)
How to resume the application.
Definition dbg.hpp:742
bool idaapi request_set_resume_mode(thid_t tid, resume_mode_t mode)
Post a set_resume_mode() request.
Definition dbg.hpp:746
bool idaapi request_step_into_backwards(void)
Post a step_into_backwards() request.
Definition dbg.hpp:674
bool idaapi request_step_until_ret(void)
Post a step_until_ret() request.
Definition dbg.hpp:736
bool idaapi request_run_to_backwards(ea_t ea, pid_t pid=NO_PROCESS, thid_t tid=NO_THREAD)
Post a run_to_backwards() request.
Definition dbg.hpp:723
bool idaapi step_into_backwards(void)
Execute one instruction backwards in the current thread.
Definition dbg.hpp:670
bool idaapi run_to_backwards(ea_t ea, pid_t pid=NO_PROCESS, thid_t tid=NO_THREAD)
Execute the process backwards until the given address is reached.
Definition dbg.hpp:719
bool idaapi step_over_backwards(void)
Execute one instruction backwards in the current thread, but without entering into functions.
Definition dbg.hpp:683
bool idaapi step_over(void)
Execute one instruction in the current thread, but without entering into functions.
Definition dbg.hpp:658
bool idaapi request_step_over_backwards(void)
Post a step_over_backwards() request.
Definition dbg.hpp:687
dbg_event_code_t idaapi wait_for_next_event(int wfne, int timeout)
Wait for the next event.
Definition dbg.hpp:2011
uint idaapi set_debugger_options(uint options)
Set debugger options.
Definition dbg.hpp:2023
dbg_event_code_t
Wait for the next debugger event.
Definition dbg.hpp:1955
THREAD_SAFE bool have_set_options(const debugger_t *_dbg)
Is set_dbg_options() implemented in debugger_t?
Definition dbg.hpp:2099
void idaapi set_remote_debugger(const char *host, const char *pass, int port=-1)
Set remote debugging options.
Definition dbg.hpp:2033
void idaapi get_process_options(qstring *path, qstring *args, launch_env_t *out_envs, qstring *sdir, qstring *host, qstring *pass, int *port)
Get process options.
Definition dbg.hpp:2039
const debug_event_t *idaapi get_debug_event(void)
Get the current debugger event.
Definition dbg.hpp:2016
const char *idaapi set_int_dbg_options(debugger_t *_dbg, const char *keyword, int32 value)
Definition dbg.hpp:2130
excvec_t *idaapi retrieve_exceptions(void)
Retrieve the exception information.
Definition dbg.hpp:2073
bool idaapi store_exceptions(void)
Update the exception information stored in the debugger module by invoking its dbg->set_exception_inf...
Definition dbg.hpp:2079
const char *idaapi set_dbg_default_options(debugger_t *_dbg, const char *keyword, int value_type, const void *value)
Definition dbg.hpp:2121
void idaapi set_process_options(const char *path, const char *args, const launch_env_t *envs, const char *sdir, const char *host, const char *pass, int port)
Set process options.
Definition dbg.hpp:2055
const char *idaapi define_exception(uint code, const char *name, const char *desc, int flags)
Convenience function: define new exception code.
Definition dbg.hpp:2090
const char *idaapi set_dbg_options(debugger_t *_dbg, const char *keyword, int pri, int value_type, const void *value)
Convenience function to set debugger specific options.
Definition dbg.hpp:2107
@ DEC_NOTASK
process does not exist
Definition dbg.hpp:1956
@ DEC_TIMEOUT
timeout
Definition dbg.hpp:1958
@ DEC_ERROR
error
Definition dbg.hpp:1957
idaman bool ida_export is_debugger_on(void)
Is the debugger currently running?
idaman void ida_export set_dbgmem_source(range_t *(idaapi *dbg_get_memory_config)(int *n), int(idaapi *memory_read)(ea_t ea, void *buffer, int size), int(idaapi *memory_write)(ea_t ea, const void *buffer, int size))
Set the memory information source for IDA kernel.
idaman bool ida_export is_debugger_memory(ea_t ea)
Is the address mapped to debugger memory?
idaman void ida_export invalidate_dbgmem_config(void)
Invalidate the debugged process memory configuration.
idaman void ida_export invalidate_dbgmem_contents(ea_t ea, asize_t size)
Invalidate the debugged process memory contents.
bool idaapi get_first_module(modinfo_t *modinfo)
Definition dbg.hpp:622
bool idaapi get_next_module(modinfo_t *modinfo)
Definition dbg.hpp:625
bool idaapi get_sp_val(ea_t *out)
Get value of the SP register for the current thread.
Definition dbg.hpp:789
bool idaapi is_reg_custom(const char *regname)
Does a register contain a value of a custom data type?
Definition dbg.hpp:828
bool idaapi request_set_reg_val(const char *regname, const regval_t *regval)
Post a set_reg_val() request.
Definition dbg.hpp:807
bool idaapi get_ip_val(ea_t *out)
Get value of the IP (program counter) register for the current thread.
Definition dbg.hpp:793
bool idaapi is_reg_float(const char *regname)
Does a register contain a floating point value?
Definition dbg.hpp:821
bool idaapi get_reg_val(const char *regname, regval_t *regval)
Read a register value from the current thread.
Definition dbg.hpp:780
bool idaapi get_dbg_reg_info(const char *regname, register_info_t *ri)
Get register information.
Definition dbg.hpp:774
bool idaapi set_reg_val(const char *regname, const regval_t *regval)
Write a register value to the current thread.
Definition dbg.hpp:799
bool idaapi is_reg_integer(const char *regname)
Does a register contain an integer value?
Definition dbg.hpp:814
source_view_t * create_source_viewer(TWidget **out_ccv, TWidget *parent, TWidget *custview, source_file_ptr sf, strvec_t *lines, int lnnum, int colnum, int flags)
Create a source code view.
Definition dbg.hpp:2547
qiterator< source_item_ptr > _source_item_iterator
Iterator for source items.
Definition dbg.hpp:2201
bool idaapi unregister_srcinfo_provider(srcinfo_provider_t *sp)
Unregister a source information provider.
Definition dbg.hpp:2539
qrefcnt_t< _source_file_iterator > source_file_iterator
Maintain a reference count for source file iterators.
Definition dbg.hpp:2260
qrefcnt_t< source_item_t > source_item_ptr
Maintain a reference count for source items.
Definition dbg.hpp:2199
bool idaapi register_srcinfo_provider(srcinfo_provider_t *sp)
Register a source information provider.
Definition dbg.hpp:2533
qiterator< source_file_ptr > _source_file_iterator
Iterator for source files.
Definition dbg.hpp:2258
qrefcnt_t< source_file_t > source_file_ptr
Maintain a reference count for source file objects.
Definition dbg.hpp:2256
idaman bool ida_export put_dbg_byte(ea_t ea, uint32 x)
Change one byte of the debugged process memory.
idaman bool ida_export get_dbg_byte(uint32 *out, ea_t ea)
Get one byte of the debugged process memory.
qvector< source_item_ptr > source_items_t
Vector of source items.
Definition dbg.hpp:2205
src_item_kind_t
Kinds of source items.
Definition dbg.hpp:2269
qrefcnt_t< _source_item_iterator > source_item_iterator
Maintain a reference count for source item iterators.
Definition dbg.hpp:2203
@ SRCIT_MODULE
module
Definition dbg.hpp:2271
@ SRCIT_STTVAR
static variable/code
Definition dbg.hpp:2275
@ SRCIT_EXPR
an expression (a+b*c)
Definition dbg.hpp:2274
@ SRCIT_FUNC
function
Definition dbg.hpp:2272
@ SRCIT_STMT
a statement (if/while/for...)
Definition dbg.hpp:2273
@ SRCIT_LOCVAR
a stack, register, or register-relative local variable or parameter
Definition dbg.hpp:2276
@ SRCIT_NONE
unknown
Definition dbg.hpp:2270
bool idaapi is_step_trace_enabled(void)
Get current state of step tracing.
Definition dbg.hpp:1369
bool disable_step_trace(void)
Definition dbg.hpp:1385
bool idaapi enable_step_trace(int enable=1)
Definition dbg.hpp:1384
bool idaapi request_enable_step_trace(int enable=1)
Definition dbg.hpp:1386
int idaapi get_step_trace_options(void)
Get current step tracing options.
Definition dbg.hpp:1420
void idaapi request_set_step_trace_options(int options)
Post a set_step_trace_options() request.
Definition dbg.hpp:1430
bool request_disable_step_trace(void)
Definition dbg.hpp:1387
void idaapi set_step_trace_options(int options)
Modify step tracing options.
Definition dbg.hpp:1426
int idaapi resume_thread(thid_t tid)
Resume thread.
Definition dbg.hpp:595
bool idaapi request_select_thread(thid_t tid)
Post a select_thread() request.
Definition dbg.hpp:567
bool idaapi select_thread(thid_t tid)
Select the given thread as the current debugged thread.
Definition dbg.hpp:563
const char *idaapi getn_thread_name(int n)
Get the NAME of a thread.
Definition dbg.hpp:552
int idaapi request_suspend_thread(thid_t tid)
Post a suspend_thread() request.
Definition dbg.hpp:584
int idaapi suspend_thread(thid_t tid)
Suspend thread.
Definition dbg.hpp:580
int idaapi request_resume_thread(thid_t tid)
Post a resume_thread() request.
Definition dbg.hpp:599
thid_t idaapi getn_thread(int n)
Get the ID of a thread.
Definition dbg.hpp:535
thid_t idaapi get_current_thread(void)
Get current thread ID.
Definition dbg.hpp:542
int idaapi get_thread_qty(void)
Get number of threads.
Definition dbg.hpp:526
bool request_disable_bblk_trace(void)
Definition dbg.hpp:1553
bool idaapi enable_bblk_trace(bool enable=true)
Definition dbg.hpp:1550
void idaapi set_bblk_trace_options(int options)
Modify basic block tracing options (see BT_LOG_INSTS)
Definition dbg.hpp:1567
int idaapi get_bblk_trace_options(void)
Get current basic block tracing options.
Definition dbg.hpp:1562
bool idaapi is_bblk_trace_enabled(void)
Definition dbg.hpp:1554
bool disable_bblk_trace(void)
Definition dbg.hpp:1551
bool idaapi request_enable_bblk_trace(bool enable=true)
Definition dbg.hpp:1552
void idaapi request_set_bblk_trace_options(int options)
Post a set_bblk_trace_options() request.
Definition dbg.hpp:1571
void idaapi request_clear_trace(void)
Post a clear_trace() request.
Definition dbg.hpp:1347
bool idaapi set_trace_size(int size)
Specify the new size of the circular buffer.
Definition dbg.hpp:1336
void idaapi clear_trace(void)
Clear all events in the trace buffer.
Definition dbg.hpp:1343
bool idaapi get_insn_tev_reg_result(int n, const char *regname, regval_t *regval)
Read the resulting register value from an instruction trace event.
Definition dbg.hpp:1675
qvector< tev_info_reg_t > tevinforeg_vec_t
vector of trace elements
Definition dbg.hpp:1797
bool idaapi get_insn_tev_reg_mem(int n, memreg_infos_t *memmap)
Read the memory pointed by register values from an instruction trace event.
Definition dbg.hpp:1663
int idaapi get_tev_qty(void)
Get number of trace events available in trace buffer.
Definition dbg.hpp:1625
qvector< tev_info_t > tevinfo_vec_t
vector of trace event info objects
Definition dbg.hpp:1606
void idaapi dbg_add_thread(thid_t tid)
Add a thread to the current trace.
Definition dbg.hpp:1758
bool idaapi get_tev_event(int n, debug_event_t *d)
Get the corresponding debug event, if any, for the specified tev object.
Definition dbg.hpp:1736
qvector< memreg_info_t > memreg_infos_t
Definition dbg.hpp:1616
void idaapi set_trace_base_address(ea_t ea)
Set the base address of the current trace.
Definition dbg.hpp:1751
qvector< debug_event_t > dbgevt_vec_t
vector of debug events
Definition dbg.hpp:1597
bool idaapi dbg_add_bpt_tev(thid_t tid, ea_t ea, ea_t bp)
Add a new breakpoint trace element to the current trace.
Definition dbg.hpp:1831
tev_type_t
Trace event types.
Definition dbg.hpp:1586
void idaapi dbg_add_tev(tev_type_t type, thid_t tid, ea_t address)
Add a new trace element to the current trace.
Definition dbg.hpp:1772
bool idaapi get_insn_tev_reg_val(int n, const char *regname, regval_t *regval)
Read a register value from an instruction trace event.
Definition dbg.hpp:1650
ea_t idaapi get_trace_base_address(void)
Get the base address of the current trace.
Definition dbg.hpp:1744
void idaapi dbg_add_debug_event(debug_event_t *event)
Add a new debug event to the current trace.
Definition dbg.hpp:1852
void idaapi dbg_del_thread(thid_t tid)
Delete a thread from the current trace.
Definition dbg.hpp:1765
save_reg_values_t
Se dbg_add_insn_tev()
Definition dbg.hpp:1802
ea_t idaapi get_bpt_tev_ea(int n)
Get the address associated to a read, read/write or execution trace event.
Definition dbg.hpp:1712
bool idaapi dbg_add_many_tevs(tevinforeg_vec_t *new_tevs)
Add many new trace elements to the current trace.
Definition dbg.hpp:1815
ea_t idaapi get_ret_tev_return(int n)
Get the return address from a function return trace event.
Definition dbg.hpp:1697
qvector< tev_reg_value_t > tev_reg_values_t
vector of trace event reg values
Definition dbg.hpp:1788
bool idaapi get_tev_info(int n, tev_info_t *tev_info)
Get main information about a trace event.
Definition dbg.hpp:1636
bool idaapi dbg_add_insn_tev(thid_t tid, ea_t ea, save_reg_values_t save=SAVE_DIFF)
Add a new instruction trace element to the current trace.
Definition dbg.hpp:1823
void idaapi dbg_add_call_tev(thid_t tid, ea_t caller, ea_t callee)
Add a new call trace element to the current trace.
Definition dbg.hpp:1838
bool idaapi get_tev_memory_info(int n, meminfo_vec_t *mi)
Get the memory layout, if any, for the specified tev object.
Definition dbg.hpp:1724
void idaapi dbg_add_ret_tev(thid_t tid, ea_t ret_insn, ea_t return_to)
Add a new return trace element to the current trace.
Definition dbg.hpp:1845
ea_t idaapi get_call_tev_callee(int n)
Get the called function from a function call trace event.
Definition dbg.hpp:1687
@ tev_max
first unused event type
Definition dbg.hpp:1594
@ tev_insn
an instruction trace
Definition dbg.hpp:1588
@ tev_bpt
write, read/write, execution trace
Definition dbg.hpp:1591
@ tev_none
no event
Definition dbg.hpp:1587
@ tev_call
a function call trace
Definition dbg.hpp:1589
@ tev_mem
memory layout changed
Definition dbg.hpp:1592
@ tev_event
debug event occurred
Definition dbg.hpp:1593
@ tev_ret
a function return trace
Definition dbg.hpp:1590
@ SAVE_DIFF
Definition dbg.hpp:1804
@ SAVE_NONE
Definition dbg.hpp:1805
@ SAVE_ALL_VALUES
Definition dbg.hpp:1803
bool disable_func_trace(void)
Definition dbg.hpp:1507
void idaapi request_set_func_trace_options(int options)
Post a set_func_trace_options() request.
Definition dbg.hpp:1529
int idaapi get_func_trace_options(void)
Get current function tracing options.
Definition dbg.hpp:1518
void idaapi set_func_trace_options(int options)
Modify function tracing options.
Definition dbg.hpp:1525
bool request_disable_func_trace(void)
Definition dbg.hpp:1509
bool idaapi request_enable_func_trace(bool enable=true)
Definition dbg.hpp:1508
bool idaapi enable_func_trace(bool enable=true)
Definition dbg.hpp:1506
bool idaapi is_func_trace_enabled(void)
Get current state of functions tracing.
Definition dbg.hpp:1499
int idaapi get_insn_trace_options(void)
Get current instruction tracing options.
Definition dbg.hpp:1469
bool disable_insn_trace(void)
Definition dbg.hpp:1458
bool idaapi is_insn_trace_enabled(void)
Get current state of instruction tracing.
Definition dbg.hpp:1451
void idaapi set_insn_trace_options(int options)
Modify instruction tracing options.
Definition dbg.hpp:1476
bool request_disable_insn_trace(void)
Definition dbg.hpp:1460
bool idaapi enable_insn_trace(bool enable=true)
Definition dbg.hpp:1457
bool idaapi request_enable_insn_trace(bool enable=true)
Definition dbg.hpp:1459
void idaapi request_set_insn_trace_options(int options)
Post a set_insn_trace_options() request.
Definition dbg.hpp:1480
void idaapi set_trace_dynamic_register_set(dynamic_register_set_t &idaregs)
Set dynamic register set of current trace.
Definition dbg.hpp:1929
const char *idaapi get_trace_platform()
Get platform name of current trace.
Definition dbg.hpp:1924
bool idaapi is_valid_trace_file(const char *filename)
Is the specified file a valid trace file for the current database?
Definition dbg.hpp:1878
bool idaapi get_trace_file_desc(qstring *buf, const char *filename)
Get the file header of the specified trace file.
Definition dbg.hpp:1888
bool idaapi choose_trace_file(qstring *buf)
Show the choose trace dialog.
Definition dbg.hpp:1893
void idaapi set_trace_platform(const char *platform)
Set platform name of current trace.
Definition dbg.hpp:1919
void idaapi get_trace_dynamic_register_set(dynamic_register_set_t *idaregs)
Get dynamic register set of current trace.
Definition dbg.hpp:1934
void idaapi set_highlight_trace_options(bool hilight, bgcolor_t color, bgcolor_t diff)
Set highlight trace parameters.
Definition dbg.hpp:1908
bool idaapi save_trace_file(const char *filename, const char *description)
Save the current trace in the specified file.
Definition dbg.hpp:1873
bool idaapi graph_trace(void)
Show the trace callgraph.
Definition dbg.hpp:1903
bool idaapi diff_trace_file(const char *NONNULL filename)
Show difference between the current trace and the one from 'filename'.
Definition dbg.hpp:1898
bool idaapi load_trace_file(qstring *buf, const char *filename)
Load a recorded trace file in the 'Tracing' window.
Definition dbg.hpp:1868
bool idaapi set_trace_file_desc(const char *filename, const char *description)
Change the description of the specified trace file.
Definition dbg.hpp:1883
bool is_request_running(void)
Is a request currently running?
Definition dbg.hpp:263
dbg_notification_t idaapi get_running_notification(void)
Get the notification associated (if any) with the current running request.
Definition dbg.hpp:271
void idaapi clear_requests_queue(void)
Clear the queue of waiting requests.
Definition dbg.hpp:279
bool idaapi run_requests(void)
Execute requests until all requests are processed or an asynchronous function is called.
Definition dbg.hpp:250
ui_notification_t idaapi get_running_request(void)
Get the current running request.
Definition dbg.hpp:258
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:1000
const tinfo_t & type
Definition hexrays.hpp:7698
carglist_t * args
Definition hexrays.hpp:7720
Contains definition of the interface to IDD modules.
qvector< exception_info_t > excvec_t
vector of exception info objects
Definition idd.hpp:557
drc_t
Debugger return codes.
Definition idd.hpp:926
resume_mode_t
How to resume the application.
Definition idd.hpp:901
int pid_t
process id
Definition idd.hpp:34
int thid_t
thread id
Definition idd.hpp:35
int bpttype_t
hardware breakpoint type (see Hardware breakpoint ids)
Definition idd.hpp:515
qvector< process_info_t > procinfo_vec_t
Definition idd.hpp:52
Contains definition of the interface to IDP modules.
Defines the interface between the kernel and the UI.
char * answer
Definition kernwin.hpp:8465
uval_t uval_t
Definition kernwin.hpp:1926
callui(ui_mbox, mbox_replace, format, va)
ui_notification_t
Events marked as 'ui:' should be used as a parameter to callui().
Definition kernwin.hpp:364
@ ui_dbg_get_trace_file_desc
Definition kernwin.hpp:1250
@ ui_dbg_request_add_bpt
Definition kernwin.hpp:1262
@ ui_dbg_request_enable_bpt
Definition kernwin.hpp:1233
@ ui_dbg_get_reg_val
Definition kernwin.hpp:1207
@ ui_dbg_request_step_over
Definition kernwin.hpp:1135
@ ui_dbg_get_bptloc_string
Definition kernwin.hpp:1220
@ ui_dbg_get_local_var
Definition kernwin.hpp:1307
@ ui_dbg_set_trace_platform
Definition kernwin.hpp:1282
@ ui_dbg_del_vmod
Definition kernwin.hpp:1216
@ ui_dbg_get_insn_tev_reg_val_i
Definition kernwin.hpp:1323
@ ui_dbg_add_tev
Definition kernwin.hpp:1271
@ ui_dbg_set_insn_trace_options
Definition kernwin.hpp:1160
@ ui_dbg_wait_for_next_event
Definition kernwin.hpp:1183
@ ui_dbg_get_reg_val_i
Definition kernwin.hpp:1325
@ ui_dbg_get_tev_event
Definition kernwin.hpp:1255
@ ui_dbg_set_trace_file_desc
Definition kernwin.hpp:1249
@ ui_dbg_edit_manual_regions
Definition kernwin.hpp:1204
@ ui_dbg_retrieve_exceptions
Definition kernwin.hpp:1188
@ ui_dbg_add_call_tev
Definition kernwin.hpp:1273
@ ui_dbg_add_path_mapping
Definition kernwin.hpp:1309
@ ui_dbg_request_del_bpt
Definition kernwin.hpp:1235
@ ui_dbg_save_trace_file
Definition kernwin.hpp:1247
@ ui_dbg_register_provider
Definition kernwin.hpp:1212
@ ui_dbg_read_memory
Definition kernwin.hpp:1225
@ ui_dbg_getn_thread
Definition kernwin.hpp:1129
@ ui_dbg_request_attach_process
Definition kernwin.hpp:1176
@ ui_dbg_step_until_ret
Definition kernwin.hpp:1138
@ ui_dbg_compare_bpt_locs
Definition kernwin.hpp:1217
@ ui_dbg_update_bpt
Definition kernwin.hpp:1263
@ ui_dbg_request_continue_process
Definition kernwin.hpp:1125
@ ui_dbg_write_register
Definition kernwin.hpp:1228
@ ui_dbg_get_running_notification
Definition kernwin.hpp:1117
@ ui_dbg_add_insn_tev
Definition kernwin.hpp:1272
@ ui_dbg_suspend_thread
Definition kernwin.hpp:1191
@ ui_dbg_is_valid_trace_file
Definition kernwin.hpp:1248
@ ui_dbg_set_reg_val_i
Definition kernwin.hpp:1326
@ ui_dbg_request_del_oldbpt
Definition kernwin.hpp:1144
@ ui_dbg_add_bpt
Definition kernwin.hpp:1261
@ ui_dbg_srcdbg_step_into
Definition kernwin.hpp:1313
@ ui_dbg_set_bptloc_string
Definition kernwin.hpp:1219
@ ui_dbg_request_run_to
Definition kernwin.hpp:1137
@ ui_dbg_request_suspend_process
Definition kernwin.hpp:1123
@ ui_dbg_set_func_trace_options
Definition kernwin.hpp:1166
@ ui_dbg_clear_trace
Definition kernwin.hpp:1148
@ ui_dbg_set_manual_regions
Definition kernwin.hpp:1199
@ ui_dbg_get_reg_value_type
Definition kernwin.hpp:1173
@ ui_dbg_set_process_state
Definition kernwin.hpp:1197
@ ui_dbg_suspend_process
Definition kernwin.hpp:1122
@ ui_dbg_get_local_vars
Definition kernwin.hpp:1308
@ ui_dbg_request_select_thread
Definition kernwin.hpp:1131
@ ui_dbg_define_exception
Definition kernwin.hpp:1190
@ ui_dbg_is_insn_trace_enabled
Definition kernwin.hpp:1156
@ ui_dbg_set_event_cond
Definition kernwin.hpp:1231
@ ui_dbg_run_requests
Definition kernwin.hpp:1115
@ ui_dbg_get_ip_val
Definition kernwin.hpp:1206
@ ui_dbg_step_into
Definition kernwin.hpp:1132
@ ui_dbg_get_bpt
Definition kernwin.hpp:1259
@ ui_dbg_add_bpt_tev
Definition kernwin.hpp:1275
@ ui_dbg_enable_manual_regions
Definition kernwin.hpp:1200
@ ui_dbg_get_tev_type
Definition kernwin.hpp:1266
@ ui_dbg_get_first_module
Definition kernwin.hpp:1179
@ ui_dbg_find_bpt
Definition kernwin.hpp:1260
@ ui_dbg_set_remote_debugger
Definition kernwin.hpp:1186
@ ui_dbg_add_vmod
Definition kernwin.hpp:1215
@ ui_dbg_add_debug_event
Definition kernwin.hpp:1276
@ ui_dbg_request_detach_process
Definition kernwin.hpp:1178
@ ui_dbg_set_resume_mode
Definition kernwin.hpp:1290
@ ui_dbg_request_set_step_trace_options
Definition kernwin.hpp:1155
@ ui_dbg_select_thread
Definition kernwin.hpp:1130
@ ui_dbg_get_tev_info
Definition kernwin.hpp:1169
@ ui_dbg_enable_func_trace
Definition kernwin.hpp:1163
@ ui_dbg_get_process_options
Definition kernwin.hpp:1195
@ ui_dbg_get_tev_tid
Definition kernwin.hpp:1267
@ ui_dbg_get_insn_tev_reg_result_i
Definition kernwin.hpp:1324
@ ui_dbg_del_bpt
Definition kernwin.hpp:1234
@ ui_dbg_get_thread_qty
Definition kernwin.hpp:1128
@ ui_dbg_srcdbg_step_until_ret
Definition kernwin.hpp:1317
@ ui_dbg_set_process_options
Definition kernwin.hpp:1201
@ ui_dbg_request_add_oldbpt
Definition kernwin.hpp:1142
@ ui_dbg_get_memory_info
Definition kernwin.hpp:1229
@ ui_dbg_request_enable_oldbpt
Definition kernwin.hpp:1146
@ ui_dbg_request_enable_bblk_trace
Definition kernwin.hpp:1241
@ ui_dbg_graph_trace
Definition kernwin.hpp:1253
@ ui_dbg_store_exceptions
Definition kernwin.hpp:1189
@ ui_dbg_is_func_trace_enabled
Definition kernwin.hpp:1162
@ ui_dbg_attach_process
Definition kernwin.hpp:1175
@ ui_dbg_del_thread
Definition kernwin.hpp:1278
@ ui_dbg_internal_get_sreg_base
Definition kernwin.hpp:1223
@ ui_dbg_srcdbg_request_step_until_ret
Definition kernwin.hpp:1318
@ ui_dbg_run_to_backwards
Definition kernwin.hpp:1343
@ ui_dbg_request_step_over_backwards
Definition kernwin.hpp:1342
@ ui_dbg_step_into_backwards
Definition kernwin.hpp:1339
@ ui_dbg_exit_process
Definition kernwin.hpp:1126
@ ui_dbg_get_call_tev_callee
Definition kernwin.hpp:1170
@ ui_dbg_get_sp_val
Definition kernwin.hpp:1205
@ ui_dbg_diff_trace_file
Definition kernwin.hpp:1252
@ ui_dbg_enable_step_trace
Definition kernwin.hpp:1151
@ ui_dbg_request_exit_process
Definition kernwin.hpp:1127
@ ui_dbg_get_tev_qty
Definition kernwin.hpp:1168
@ ui_dbg_request_set_insn_trace_options
Definition kernwin.hpp:1161
@ ui_dbg_is_bblk_trace_enabled
Definition kernwin.hpp:1239
@ ui_dbg_get_module_info
Definition kernwin.hpp:1302
@ ui_create_source_viewer
ui: Create new source viewer.
Definition kernwin.hpp:771
@ ui_dbg_internal_set_elang
Definition kernwin.hpp:1286
@ ui_dbg_change_bptlocs
Definition kernwin.hpp:1298
@ ui_dbg_step_over_backwards
Definition kernwin.hpp:1341
@ ui_dbg_get_reg_info
Definition kernwin.hpp:1328
@ ui_dbg_enable_oldbpt
Definition kernwin.hpp:1145
@ ui_dbg_unregister_provider
Definition kernwin.hpp:1213
@ ui_null
Definition kernwin.hpp:365
@ ui_dbg_get_process_state
Definition kernwin.hpp:1119
@ ui_dbg_continue_process
Definition kernwin.hpp:1124
@ ui_dbg_get_bpt_group
Definition kernwin.hpp:1297
@ ui_dbg_write_memory
Definition kernwin.hpp:1226
@ ui_dbg_collect_stack_trace
Definition kernwin.hpp:1301
@ ui_dbg_del_oldbpt
Definition kernwin.hpp:1143
@ ui_dbg_get_insn_tev_reg_mem
Definition kernwin.hpp:1256
@ ui_dbg_set_trace_size
Definition kernwin.hpp:1147
@ ui_dbg_start_process
Definition kernwin.hpp:1120
@ ui_dbg_get_trace_dynamic_register_set
Definition kernwin.hpp:1331
@ ui_dbg_get_trace_platform
Definition kernwin.hpp:1283
@ ui_dbg_bring_to_front
Definition kernwin.hpp:1181
@ ui_dbg_set_bptloc_group
Definition kernwin.hpp:1292
@ ui_dbg_request_clear_trace
Definition kernwin.hpp:1149
@ ui_dbg_srcdbg_request_step_over
Definition kernwin.hpp:1316
@ ui_dbg_get_bpt_tev_ea
Definition kernwin.hpp:1172
@ ui_dbg_get_trace_base_address
Definition kernwin.hpp:1268
@ ui_dbg_continue_backwards
Definition kernwin.hpp:1337
@ ui_dbg_get_grp_bpts
Definition kernwin.hpp:1296
@ ui_dbg_internal_get_elang
Definition kernwin.hpp:1285
@ ui_dbg_request_resume_thread
Definition kernwin.hpp:1194
@ ui_dbg_request_step_into
Definition kernwin.hpp:1133
@ ui_dbg_get_current_source_line
Definition kernwin.hpp:1311
@ ui_dbg_get_srcinfo_provider
Definition kernwin.hpp:1305
@ ui_dbg_request_set_func_trace_options
Definition kernwin.hpp:1167
@ ui_dbg_getn_bpt
Definition kernwin.hpp:1258
@ ui_dbg_resume_thread
Definition kernwin.hpp:1193
@ ui_dbg_request_set_resume_mode
Definition kernwin.hpp:1291
@ ui_dbg_get_insn_tev_reg_val
Definition kernwin.hpp:1210
@ ui_dbg_get_tev_ea
Definition kernwin.hpp:1265
@ ui_dbg_check_bpt
Definition kernwin.hpp:1196
@ ui_dbg_get_ret_tev_return
Definition kernwin.hpp:1171
@ ui_dbg_request_suspend_thread
Definition kernwin.hpp:1192
@ ui_dbg_get_tev_memory_info
Definition kernwin.hpp:1254
@ ui_dbg_add_ret_tev
Definition kernwin.hpp:1274
@ ui_dbg_add_thread
Definition kernwin.hpp:1277
@ ui_dbg_hide_all_bpts
Definition kernwin.hpp:1203
@ ui_dbg_read_registers
Definition kernwin.hpp:1227
@ ui_dbg_enable_bptgrp
Definition kernwin.hpp:1334
@ ui_dbg_enable_bpt
Definition kernwin.hpp:1232
@ ui_dbg_add_oldbpt
Definition kernwin.hpp:1141
@ ui_dbg_list_bptgrps
Definition kernwin.hpp:1293
@ ui_dbg_request_enable_step_trace
Definition kernwin.hpp:1152
@ ui_dbg_enable_insn_trace
Definition kernwin.hpp:1157
@ ui_dbg_get_insn_tev_reg_result
Definition kernwin.hpp:1211
@ ui_dbg_set_trace_dynamic_register_set
Definition kernwin.hpp:1330
@ ui_dbg_getn_thread_name
Definition kernwin.hpp:1320
@ ui_dbg_get_step_trace_options
Definition kernwin.hpp:1153
@ ui_dbg_get_event_cond
Definition kernwin.hpp:1230
@ ui_dbg_load_debugger
Definition kernwin.hpp:1187
@ ui_dbg_request_step_into_backwards
Definition kernwin.hpp:1340
@ ui_dbg_get_next_module
Definition kernwin.hpp:1180
@ ui_dbg_set_reg_val
Definition kernwin.hpp:1208
@ ui_dbg_get_func_trace_options
Definition kernwin.hpp:1165
@ ui_dbg_get_current_source_file
Definition kernwin.hpp:1310
@ ui_dbg_get_debug_event
Definition kernwin.hpp:1184
@ ui_dbg_request_continue_backwards
Definition kernwin.hpp:1338
@ ui_dbg_internal_cleanup_appcall
Definition kernwin.hpp:1222
@ ui_dbg_load_trace_file
Definition kernwin.hpp:1246
@ ui_dbg_request_set_reg_val
Definition kernwin.hpp:1209
@ ui_dbg_enable_bblk_trace
Definition kernwin.hpp:1240
@ ui_dbg_request_start_process
Definition kernwin.hpp:1121
@ ui_dbg_add_many_tevs
Definition kernwin.hpp:1279
@ ui_dbg_set_trace_base_address
Definition kernwin.hpp:1270
@ ui_dbg_srcdbg_request_step_into
Definition kernwin.hpp:1314
@ ui_dbg_srcdbg_step_over
Definition kernwin.hpp:1315
@ ui_dbg_clear_requests_queue
Definition kernwin.hpp:1118
@ ui_dbg_is_step_trace_enabled
Definition kernwin.hpp:1150
@ ui_dbg_get_manual_regions
Definition kernwin.hpp:1198
@ ui_dbg_handle_debug_event
Definition kernwin.hpp:1214
@ ui_dbg_run_to
Definition kernwin.hpp:1136
@ ui_dbg_for_all_bpts
Definition kernwin.hpp:1264
@ ui_dbg_request_enable_func_trace
Definition kernwin.hpp:1164
@ ui_dbg_detach_process
Definition kernwin.hpp:1177
@ ui_dbg_request_run_to_backwards
Definition kernwin.hpp:1344
@ ui_dbg_request_set_bblk_trace_options
Definition kernwin.hpp:1244
@ ui_dbg_set_step_trace_options
Definition kernwin.hpp:1154
@ ui_dbg_set_highlight_trace_options
Definition kernwin.hpp:1281
@ ui_dbg_del_bptgrp
Definition kernwin.hpp:1295
@ ui_dbg_rename_bptgrp
Definition kernwin.hpp:1294
@ ui_dbg_get_bpt_qty
Definition kernwin.hpp:1140
@ ui_dbg_set_debugger_options
Definition kernwin.hpp:1185
@ ui_dbg_get_current_thread
Definition kernwin.hpp:1182
@ ui_dbg_set_bblk_trace_options
Definition kernwin.hpp:1243
@ ui_dbg_internal_ioctl
Definition kernwin.hpp:1224
@ ui_dbg_get_insn_trace_options
Definition kernwin.hpp:1159
@ ui_dbg_bin_search
Definition kernwin.hpp:1321
@ ui_dbg_request_step_until_ret
Definition kernwin.hpp:1139
@ ui_dbg_choose_trace_file
Definition kernwin.hpp:1251
@ ui_dbg_get_processes
Definition kernwin.hpp:1174
@ ui_dbg_request_enable_insn_trace
Definition kernwin.hpp:1158
@ ui_dbg_set_bpt_group
Definition kernwin.hpp:1280
@ ui_dbg_get_running_request
Definition kernwin.hpp:1116
@ ui_dbg_get_global_var
Definition kernwin.hpp:1306
@ ui_dbg_get_bblk_trace_options
Definition kernwin.hpp:1242
@ ui_dbg_step_over
Definition kernwin.hpp:1134
@ ui_dbg_is_busy
Definition kernwin.hpp:1202
idaman callui_t ida_export_data(idaapi *callui)(ui_notification_t what
Pointer to the user-interface dispatcher function.
asize_t size
Definition kernwin.hpp:6701
QT::QWidget TWidget
Definition kernwin.hpp:2075
qvector< simpleline_t > strvec_t
A collection of simple lines to populate a custom view.
Definition kernwin.hpp:1765
unsigned __int64 uint64
Definition llong.hpp:13
qvector< qstring > qstrvec_t
Definition lumina.hpp:831
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
uint64 asize_t
Definition pro.h:427
uint32 bgcolor_t
background color in RGB
Definition pro.h:5109
adiff_t sval_t
signed value used by the processor.
Definition pro.h:450
uint64 ea_t
Definition pro.h:425
int int32
signed 32 bit value
Definition pro.h:351
unsigned int uint
unsigned 32 bit value
Definition pro.h:343
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2838
uval_t inode_t
The inode_t type is the specialization specific inode number.
Definition pro.h:468
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' is not zero.
Definition pro.h:1530
unsigned char uint8
unsigned 8 bit value
Definition pro.h:348
_qstring< char > qstring
regular string
Definition pro.h:3771
unsigned int
Definition pronet.h:99
Describes a breakpoint location.
Definition dbg.hpp:891
bool operator!=(const bpt_location_t &r) const
Definition dbg.hpp:952
bool is_empty_path(void) const
No path/filename specified? (BPLT_REL, BPLT_SRC)
Definition dbg.hpp:898
const char * symbol(void) const
Get symbol name (BPLT_SYM)
Definition dbg.hpp:900
void set_src_bpt(const char *fn, int _lineno)
Specify a source level location.
Definition dbg.hpp:918
uval_t offset(void) const
Get offset (BPLT_REL, BPLT_SYM)
Definition dbg.hpp:902
int compare(const bpt_location_t &r) const
Lexically compare two breakpoint locations.
Definition dbg.hpp:947
void set_sym_bpt(const char *_symbol, uval_t _offset=0)
Specify a symbolic location.
Definition dbg.hpp:926
bool valid() const
Locations that are absolute+BADADDR, are considered invalid.
Definition dbg.hpp:908
void set_abs_bpt(ea_t a)
Specify an absolute address location.
Definition dbg.hpp:911
size_t print(qstring *buf) const
Internal function.
bool operator<=(const bpt_location_t &r) const
Definition dbg.hpp:955
bool operator<(const bpt_location_t &r) const
Definition dbg.hpp:953
bool operator>=(const bpt_location_t &r) const
Definition dbg.hpp:956
ea_t info
Definition dbg.hpp:893
const char * path(void) const
Get path/filename (BPLT_REL, BPLT_SRC)
Definition dbg.hpp:899
int index
Definition dbg.hpp:894
bpt_location_t(void)
Constructor (default type is BPLT_ABS)
Definition dbg.hpp:905
bool operator==(const bpt_location_t &r) const
Definition dbg.hpp:951
int lineno(void) const
Get line number (BPLT_SRC)
Definition dbg.hpp:901
void set_rel_bpt(const char *mod, uval_t _offset)
Specify a relative address location.
Definition dbg.hpp:934
bool operator>(const bpt_location_t &r) const
Definition dbg.hpp:954
ea_t ea(void) const
Get address (BPLT_ABS)
Definition dbg.hpp:903
bpt_loctype_t loctype
Definition dbg.hpp:895
bpt_loctype_t type(void) const
Get bpt type.
Definition dbg.hpp:897
Characteristics of a breakpoint.
Definition dbg.hpp:965
void set_abs_bpt(ea_t a)
Set bpt location to an absolute address.
Definition dbg.hpp:1039
int get_size(void) const
Get bpt size.
Definition dbg.hpp:1037
uint32 props
Internal breakpoint properties
Definition dbg.hpp:997
bool is_symbpt(void) const
Is symbolic breakpoint?
Definition dbg.hpp:1049
int cndidx
Internal number of the condition (<0-none)
Definition dbg.hpp:1014
bool set_trace_action(bool enable, int trace_types)
Configure tracing options.
Definition dbg.hpp:1059
bool is_tracemodebpt(void) const
Does breakpoint trace anything?
Definition dbg.hpp:1053
bool enabled(void) const
Is breakpoint enabled?
Definition dbg.hpp:1022
int pass_count
Number of times the breakpoint is hit before stopping (default is 0: stop always)
Definition dbg.hpp:973
thid_t tid
breakpoint thread id
Definition dbg.hpp:970
size_t get_cnd_elang_idx() const
Definition dbg.hpp:1076
void set_cond(const char *cnd)
Internal function.
bool is_active(void) const
Written completely to process?
Definition dbg.hpp:1028
bool is_page_bpt(void) const
Page breakpoint?
Definition dbg.hpp:1034
inode_t bptid
Internal breakpoint id.
Definition dbg.hpp:1015
int size
Size of the breakpoint (0 for software breakpoints)
Definition dbg.hpp:1013
pid_t pid
breakpoint process id
Definition dbg.hpp:969
void set_sym_bpt(const char *sym, uval_t o)
Set bpt location to a symbol.
Definition dbg.hpp:1043
bpt_t(void)
Definition dbg.hpp:1017
bool is_relbpt(void) const
Is relative address breakpoint?
Definition dbg.hpp:1048
qstring cndbody
Condition as entered by the user.
Definition dbg.hpp:967
bool is_traceonbpt(void) const
Is this a tracing breakpoint, and is tracing enabled?
Definition dbg.hpp:1055
bpt_location_t loc
Location.
Definition dbg.hpp:968
bool listbpt(void) const
Include in the bpt list?
Definition dbg.hpp:1025
uint32 flags
Breakpoint property bits
Definition dbg.hpp:975
bool is_inactive(void) const
Not written to process at all?
Definition dbg.hpp:1032
bool is_traceoffbpt(void) const
Is this a tracing breakpoint, and is tracing disabled?
Definition dbg.hpp:1057
bool is_compiled(void) const
Condition has been compiled?
Definition dbg.hpp:1026
bool is_low_level(void) const
Is bpt condition calculated at low level?
Definition dbg.hpp:1023
bool eval_cond(ea_t ea, bool *fire, const char *bpt_type)
Internal function.
bool is_absbpt(void) const
Is absolute address breakpoint?
Definition dbg.hpp:1047
bool is_srcbpt(void) const
Is source level breakpoint?
Definition dbg.hpp:1050
bool badbpt(void) const
Failed to write bpt to process memory?
Definition dbg.hpp:1024
bpttype_t type
Breakpoint type.
Definition dbg.hpp:972
bool is_partially_active(void) const
Written partially to process?
Definition dbg.hpp:1030
bool set_cnd_elang(const char *name)
Set the scripting language name for the condition string.
Definition dbg.hpp:2774
ea_t ea
Address, if known. For BPLT_SRC, index into an internal data struct.
Definition dbg.hpp:971
bool is_hwbpt(void) const
Is hardware breakpoint?
Definition dbg.hpp:1021
void set_src_bpt(const char *fn, int lineno)
Set bpt location to a source line.
Definition dbg.hpp:1041
void set_rel_bpt(const char *mod, uval_t o)
Set bpt location to a relative address.
Definition dbg.hpp:1045
size_t cb
size of this structure
Definition dbg.hpp:966
const char * get_cnd_elang() const
Get the scripting language name for the condition string.
Definition dbg.hpp:2773
range_t range
if specified, restricts the address range
Definition dbg.hpp:1276
const char * name
if specified, restricts bpts to the ones that match the given name
Definition dbg.hpp:1277
bpt_visitor_t(void)
Definition dbg.hpp:1278
int idaapi for_all_bpts(int bvflags)
Definition dbg.hpp:1281
virtual int idaapi visit_bpt(const bpt_t *bpt)=0
Defines action taken when breakpoint is visited.
Definition dbg.hpp:864
bpt_t * bpt
Definition dbg.hpp:865
defined as struct so it can be forward-declared
Definition idd.hpp:751
Definition dbg.hpp:2785
int deref_limit
Definition dbg.hpp:2789
bool hide_default_segments
Definition dbg.hpp:2790
This structure is used only when detailed information about a debug event is needed.
Definition idd.hpp:362
This structure describes a debugger API module.
Definition idd.hpp:952
bool have_set_options() const
Definition idd.hpp:2057
drc_t set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value)
Definition idd.hpp:2053
bool may_disturb() const
Definition idd.hpp:1081
Definition idd.hpp:125
Used by debugger modules to launch processes with environment variables.
Definition idd.hpp:277
vector of memory info objects
Definition idd.hpp:260
Required typedef for get_insn_tev_reg_mem()
Definition dbg.hpp:1611
ea_t ea
Definition dbg.hpp:1612
bytevec_t bytes
Definition dbg.hpp:1613
Describes a module load event.
Definition idd.hpp:329
Definition dbg.hpp:1083
bpt_location_t to
Definition dbg.hpp:1085
bpt_location_t from
Definition dbg.hpp:1084
Base class for an range.
Definition range.hpp:35
Debuggee register information.
Definition idd.hpp:95
Structure to hold a register value.
Definition idd.hpp:563
Structure used for dbg_add_many_tevs()
Definition dbg.hpp:1792
tev_info_t info
Definition dbg.hpp:1793
tev_reg_values_t registers
Definition dbg.hpp:1794
Common information for all trace events.
Definition dbg.hpp:1601
ea_t ea
address where the event occurred
Definition dbg.hpp:1604
thid_t tid
thread where the event was recorded
Definition dbg.hpp:1603
tev_type_t type
trace event type
Definition dbg.hpp:1602
Structure used for dbg_add_many_tevs()
Definition dbg.hpp:1778
regval_t value
Definition dbg.hpp:1779
int reg_idx
Definition dbg.hpp:1780
tev_reg_value_t(int _reg_idx=-1, uint64 _value=uint64(-1))
Definition dbg.hpp:1782