IDA C++ SDK 9.2
Loading...
Searching...
No Matches
idd.hpp
Go to the documentation of this file.
1/*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2025 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
8#ifndef _IDD_HPP
9#define _IDD_HPP
10
11#include <range.hpp>
12#include <ua.hpp>
13
21
23#define IDD_INTERFACE_VERSION 31
24
25class idc_value_t;
26struct fpvalue_t;
27class tinfo_t;
28
29//====================================================================
30//
31// Process and Threads
32//
33
34typedef int pid_t;
35typedef int thid_t;
36
37#define NO_PROCESS pid_t(-1)
38#define NO_THREAD 0
44
53
54//--------------------------------------------------------------------
58{
59 int32 cbsize = sizeof(*this);
60
69
72
74#ifdef __EA64__
75#define DEF_ADDRSIZE 8
76#else
77#define DEF_ADDRSIZE 4
78#endif
79 int is_be = -1;
80
81 debapp_attrs_t() : addrsize(DEF_ADDRSIZE) {}
82};
83
84//====================================================================
85//
86// Registers
87//
88
89typedef unsigned char register_class_t;
92
95{
96 const char *name;
101#define REGISTER_READONLY 0x0001
102#define REGISTER_IP 0x0002
103#define REGISTER_SP 0x0004
104#define REGISTER_FP 0x0008
105#define REGISTER_ADDRESS 0x0010
106#define REGISTER_CS 0x0020
107#define REGISTER_SS 0x0040
108#define REGISTER_NOLF 0x0080
110#define REGISTER_CUSTFMT 0x0100
116 const char *const *bit_strings;
119};
122
123//--------------------------------------------------------------------------
125{
127
134
135 void clear()
136 {
137 ri_vec.clear();
138 strvec.clear();
139 classname_ptrs.clear();
140 bit_strings_ptrs_vec.clear();
141 }
142
144 {
146 ri.flags,
147 ri.dtype,
149 ri.bit_strings,
151 }
152
154 const char *name,
155 int flags,
156 op_dtype_t dtype,
157 register_class_t register_class,
158 const char *const *bit_strings,
159 uval_t bits_mask)
160 {
161 // Allocate bit_strings.
162 if ( bit_strings != nullptr )
163 {
164 size_t num_bits = (flags & REGISTER_CUSTFMT) != 0 ? 1
165 : dtype == dt_word ? 16
166 : dtype == dt_dword ? 32
167 : dtype == dt_qword ? 64
168 : 0;
169 QASSERT(1795, num_bits != 0);
170 const_char_vec_t &ptrvec = bit_strings_ptrs_vec.push_back();
171 ptrvec.resize(num_bits, nullptr);
172 for ( size_t i = 0; i < num_bits; i++ )
173 {
174 if ( bit_strings[i] != nullptr )
175 {
176 qstring &field_name = strvec.push_back();
177 field_name = bit_strings[i];
178 ptrvec[i] = field_name.c_str();
179 }
180 }
181 bit_strings = ptrvec.begin();
182 }
183
184 // Allocate name.
185 qstring &regname = strvec.push_back();
186 regname = name;
187
188 // Add entry for register.
189 register_info_t &ri = ri_vec.push_back();
190 ri.name = regname.c_str();
191 ri.flags = flags;
192 ri.dtype = dtype;
193 ri.register_class_mask = register_class;
194 ri.bit_strings = bit_strings;
195 ri.default_bit_strings_mask = bits_mask;
196 }
197
198 void set_regclasses(const char **register_classes, int default_regcls)
199 {
200 while ( *register_classes != nullptr )
201 {
202 qstring &register_class = strvec.push_back();
203 register_class = *register_classes++;
204 classname_ptrs.push_back(register_class.begin());
205 }
206 classname_ptrs.push_back(nullptr);
207 default_regclasses = default_regcls;
208 }
209
210 // Values for debugger_t.
211 bool empty() const { return ri_vec.empty(); }
212 size_t nregs() const { return ri_vec.size(); }
213 register_info_t *registers() { return ri_vec.begin(); }
214 const char **regclasses() { return classname_ptrs.begin(); }
215};
216
217// helper functions:
218idaman THREAD_SAFE void ida_export serialize_dynamic_register_set(
219 bytevec_t *buf,
220 dynamic_register_set_t &idaregs);
221idaman THREAD_SAFE void ida_export deserialize_dynamic_register_set(
222 dynamic_register_set_t *idaregs,
223 memory_deserializer_t &mmdsr);
224idaman THREAD_SAFE void ida_export serialize_insn(
225 bytevec_t *s,
226 const insn_t &insn);
227idaman THREAD_SAFE void ida_export deserialize_insn(
228 insn_t *insn,
229 memory_deserializer_t &mmdsr);
230
231//====================================================================
232//
233// Memory
234//
235
238struct memory_info_t : public range_t
239{
246
247 bool operator ==(const memory_info_t &r) const
248 {
249 return start_ea == r.start_ea
250 && end_ea == r.end_ea
251 && name == r.name
252 && sclass == r.sclass
253 && sbase == r.sbase
254 && bitness == r.bitness
255 && perm == r.perm;
256 }
257 bool operator !=(const memory_info_t &r) const { return !(*this == r); }
258};
260struct meminfo_vec_t : public qvector<memory_info_t> {};
261
264{
266};
269
270//====================================================================
271//
272// Debug events
273//
274
276struct launch_env_t : public qstrvec_t
277{
278 bool merge = true; // merge environment variables with system ones
279 // or replace it completely
280};
281
319
320// helper functions:
321struct debug_event_t;
322idaman THREAD_SAFE void ida_export free_debug_event(debug_event_t *ev);
323idaman THREAD_SAFE void ida_export copy_debug_event(debug_event_t *ev, const debug_event_t &r);
324idaman THREAD_SAFE void ida_export set_debug_event_code(debug_event_t *ev, event_id_t id);
325
337
341{
342 ea_t hea = BADADDR;
343 ea_t kea = BADADDR;
347};
348
358
362{
363 pid_t pid = NO_PROCESS;
364 thid_t tid = NO_THREAD;
365 ea_t ea = BADADDR;
366 bool handled = false;
369private:
370 event_id_t _eid = NO_EVENT;
371#ifndef SWIG
372 char bytes[qmax(sizeof(modinfo_t), sizeof(excinfo_t))];
373#endif
374
375public:
376 debug_event_t() { memset(bytes, 0, sizeof(bytes)); }
379 debug_event_t &operator =(const debug_event_t &r) { return copy(r); }
380 debug_event_t &copy(const debug_event_t &r) { copy_debug_event(this, r); return *this; }
381
383 void clear() { free_debug_event(this); }
384
386 {
387 clear();
388 pid = NO_PROCESS;
389 tid = NO_THREAD;
390 ea = BADADDR;
391 handled = false;
392 }
393
395 event_id_t eid() const { return event_id_t(_eid & ~STATUS_MASK); }
396
402
404 bool is_bitness_changed() const { return (_eid & BITNESS_CHANGED) != 0; }
405 void set_bitness_changed(bool on=true) { setflag(_eid, BITNESS_CHANGED, on); }
406
408
411 {
412 QASSERT(3295, eid() == PROCESS_STARTED || eid() == PROCESS_ATTACHED || eid() == LIB_LOADED);
413 return *(modinfo_t *)bytes;
414 }
417 {
418 QASSERT(3296, eid() == PROCESS_EXITED || eid() == THREAD_EXITED);
419 return *(int *)bytes;
420 }
425 {
426 QASSERT(3297, eid() == THREAD_STARTED || eid() == LIB_UNLOADED || eid() == INFORMATION);
427 return *(qstring *)bytes;
428 }
431 {
432 QASSERT(3298, eid() == BREAKPOINT);
433 return *(bptaddr_t *)bytes;
434 }
437 {
438 QASSERT(3299, eid() == EXCEPTION);
439 return *(excinfo_t *)bytes;
440 }
441
442 const modinfo_t &modinfo() const { return CONST_CAST(debug_event_t*)(this)->modinfo(); }
443 const int &exit_code() const { return CONST_CAST(debug_event_t*)(this)->exit_code(); }
444 const qstring &info() const { return CONST_CAST(debug_event_t*)(this)->info(); }
445 const bptaddr_t &bpt() const { return CONST_CAST(debug_event_t*)(this)->bpt(); }
446 const excinfo_t &exc() const { return CONST_CAST(debug_event_t*)(this)->exc(); }
447
449 {
450 set_eid(id);
451 return modinfo();
452 }
453
455 {
456 set_eid(id);
457 exit_code() = code;
458 }
459
461 {
462 set_eid(id);
463 return info();
464 }
465
467 {
469 return bpt();
470 }
471
473 {
475 return exc();
476 }
477
480 ea_t bpt_ea() const
481 {
482 return _eid == BREAKPOINT && bpt().kea != BADADDR ? bpt().kea : ea;
483 }
484
485 friend THREAD_SAFE void ida_export free_debug_event(debug_event_t *ev);
486 friend THREAD_SAFE void ida_export copy_debug_event(debug_event_t *ev, const debug_event_t &r);
487 friend THREAD_SAFE void ida_export set_debug_event_code(debug_event_t *ev, event_id_t id);
488};
490
492inline const char *get_debug_event_name(const debug_event_t &dev)
493{
494 switch ( dev.eid() )
495 {
496 case NO_EVENT: return "NO_EVENT";
497 case THREAD_STARTED: return "THREAD_STARTED";
498 case STEP: return "STEP";
499 case PROCESS_DETACHED: return "PROCESS_DETACHED";
500 case PROCESS_STARTED: return "PROCESS_STARTED";
501 case PROCESS_ATTACHED: return "PROCESS_ATTACHED";
502 case PROCESS_SUSPENDED: return "PROCESS_SUSPENDED";
503 case LIB_LOADED: return "LIB_LOADED";
504 case PROCESS_EXITED: return "PROCESS_EXITED";
505 case THREAD_EXITED: return "THREAD_EXITED";
506 case BREAKPOINT: return "BREAKPOINT";
507 case EXCEPTION: return "EXCEPTION";
508 case LIB_UNLOADED: return "LIB_UNLOADED";
509 case INFORMATION: return "INFORMATION";
510 case TRACE_FULL: return "TRACE_FULL";
511 default: return "???";
512 }
513}
514
515typedef int bpttype_t;
516
520const bpttype_t
528
531{
532 uint code = 0;
537#define EXC_BREAK 0x0001
538#define EXC_HANDLE 0x0002
539#define EXC_MSG 0x0004
540#define EXC_SILENT 0x0008
542
544 bool break_on() const { return (flags & EXC_BREAK) != 0; }
545
547 bool handle() const { return (flags & EXC_HANDLE) != 0; }
548
551
553 exception_info_t(uint _code, uint32 _flags, const char *_name, const char *_desc)
554 : code(_code), flags(_flags), name(_name), desc(_desc) {}
555};
558
563{
567#define RVT_FLOAT (-1)
568#define RVT_INT (-2)
569#define RVT_UNAVAILABLE (-3)
572 int32 rvtype = RVT_INT;
573#ifndef SWIG
574 // this union must be the last member (see memset below)
575 union
576 {
577#endif
579#ifndef SWIG
585 };
586#endif
587 bool use_bytevec() const { return rvtype >= RVT_FLOAT; } // floating and custom types
589 {
590 memset(reserve, 0, sizeof(regval_t) - qoffsetof(regval_t, reserve));
591 ival = ~uint64(0);
592 }
594 {
595 memset(reserve, 0, sizeof(regval_t) - qoffsetof(regval_t, reserve));
596 *this = r;
597 }
599
602 {
603 if ( this == &r )
604 return *this;
605 if ( r.use_bytevec() )
606 {
607 if ( use_bytevec() )
608 bytes() = r.bytes();
609 else
610 new (&bytes()) bytevec_t(r.bytes());
611 }
612 else
613 {
614 if ( use_bytevec() )
615 bytes().~bytevec_t();
616 ival = r.ival;
617 }
618 rvtype = r.rvtype;
619 return *this;
620 }
621
623 void clear()
624 {
625 if ( use_bytevec() )
626 {
627 bytes().~bytevec_t();
628 rvtype = RVT_INT;
629 }
630 }
631
633 bool operator == (const regval_t &r) const
634 {
635 if ( rvtype == r.rvtype )
636 {
637 if ( rvtype == RVT_UNAVAILABLE )
638 return true;
639 if ( rvtype == RVT_INT )
640 return ival == r.ival;
641 return bytes() == r.bytes();
642 }
643 return false;
644 }
645
647 bool operator != (const regval_t &r) const { return !(*this == r); }
648
650 void swap(regval_t &r) { qswap(*this, r); }
651
653 void _set_int(uint64 x) { ival = x; }
655 void _set_float(const bytevec_t &v) { new (&bytes()) bytevec_t(v); rvtype = RVT_FLOAT; }
657 void _set_bytes(const uchar *data, size_t size, int _rvtype=0)
658 {
659 new (&bytes()) bytevec_t(data, size);
660 rvtype = _rvtype;
661 QASSERT(3214, use_bytevec());
662 }
663
664 void _set_bytes(const bytevec_t &v, int _rvtype=0)
665 {
666 new (&bytes()) bytevec_t(v);
667 rvtype = _rvtype;
668 QASSERT(3215, use_bytevec());
669 }
670
671 bytevec_t &_set_bytes(int _rvtype)
672 {
673 new (&bytes()) bytevec_t;
674 rvtype = _rvtype;
675 QASSERT(3216, use_bytevec());
676 return bytes();
677 }
678
679 void _set_unavailable() { ival = 0; rvtype = RVT_UNAVAILABLE; }
680
685 void set_int(uint64 x) { clear(); _set_int(x); }
687 void set_float(const bytevec_t &v) { set_bytes(v, RVT_FLOAT); }
689 void set_bytes(const uchar *data, size_t size, int _rvtype=0) { clear(); _set_bytes(data, size, _rvtype); }
691 void set_bytes(const bytevec_t &v, int _rvtype=0) { clear(); _set_bytes(v, _rvtype); }
693 bytevec_t &set_bytes(int _rvtype) { clear(); _set_bytes(_rvtype); return bytes(); }
696
698
702 bytevec_t &bytes() { return *(bytevec_t *)reserve; }
704 const bytevec_t &bytes() const { return *(bytevec_t *)reserve; }
706 void *get_data() { return use_bytevec() ? (void *)bytes().begin() : (void *)&ival; }
708 const void *get_data() const { return use_bytevec() ? (void *)bytes().begin() : (void *)&ival; }
710 size_t get_data_size() const
711 {
712 if ( use_bytevec() )
713 return bytes().size();
714 if ( rvtype == RVT_INT )
715 return sizeof(ival);
716 return 0;
717 }
718
719};
722
725{
726 bool modified = false;
727 ea_t ea = BADADDR;
729 int debregidx = -1;
730 int value_size = 0;
731};
732
735{
740 bool funcok;
741 bool operator==(const call_stack_info_t &r) const
742 {
743 return callea == r.callea
744 && funcea == r.funcea
745 && funcok == r.funcok
746 && fp == r.fp;
747 }
748 bool operator!=(const call_stack_info_t &r) const { return !(*this == r); }
749};
751struct call_stack_t : public qvector<call_stack_info_t> {};
752
753//-------------------------------------------------------------------------
754THREAD_SAFE inline void append_regval(bytevec_t &s, const regval_t &value)
755{
756 s.pack_dd(value.rvtype+3);
757 if ( value.rvtype == RVT_INT )
758 {
759 s.pack_dq(value.ival+1); // +1 to efficiently serialize 0xffffffff
760 }
761 else if ( value.rvtype != RVT_UNAVAILABLE )
762 {
763 const bytevec_t &b = value.bytes();
764 s.pack_dd(b.size());
765 s.append(b.begin(), b.size());
766 }
767}
768
769//-------------------------------------------------------------------------
770template <class T>
771THREAD_SAFE inline void extract_regval(regval_t *out, T &v)
772{
773 out->clear();
774 out->rvtype = extract_dd(v) - 3;
775 if ( out->rvtype == RVT_INT )
776 {
777 out->ival = extract_dq(v) - 1;
778 }
779 else if ( out->rvtype != RVT_UNAVAILABLE )
780 {
781 bytevec_t &b = out->_set_bytes(out->rvtype);
782 int size = extract_dd(v);
783 b.resize(size);
784 extract_obj(v, b.begin(), size);
785 }
786}
787
788//-------------------------------------------------------------------------
789template <class T>
790THREAD_SAFE inline void extract_regvals(
791 regval_t *values,
792 int n,
793 T &v,
794 const uchar *regmap)
795{
796 for ( int i=0; i < n && !v.eof(); i++ )
797 if ( regmap == nullptr || test_bit(regmap, i) )
798 extract_regval(&values[i], v);
799}
800
801//--------------------------------------------------------------------------
802THREAD_SAFE inline void unpack_regvals(
803 regval_t *values,
804 int n,
805 const uchar *regmap,
807{
808 extract_regvals(values, n, mmdsr, regmap);
809}
810
811
823
824idaman error_t ida_export dbg_appcall(
825 idc_value_t *retval,
826 ea_t func_ea,
827 thid_t tid,
828 const tinfo_t *ptif,
829 idc_value_t *argv,
830 size_t argnum);
831
832
838
839idaman error_t ida_export cleanup_appcall(thid_t tid);
840
841
850
853{
854 ea_t ea = BADADDR;
857 int size = 0;
860 pid_t pid = NO_PROCESS;
861 thid_t tid = NO_THREAD;
862
864 bool operator==(const update_bpt_info_t &b) const
865 {
866 return ea == b.ea && type == b.type;
867 }
868};
871
887
896
897//====================================================================
914
915//====================================================================
916// Tracing bits
917#define STEP_TRACE 0x01
918#define INSN_TRACE 0x02
919#define FUNC_TRACE 0x04
920#define BBLK_TRACE 0x08
921
922//====================================================================
939
940//====================================================================
948{
951 const char *name;
952 int id;
953
957 #define DEBUGGER_ID_X86_IA32_WIN32_USER 0
958 #define DEBUGGER_ID_X86_IA32_LINUX_USER 1
959 #define DEBUGGER_ID_X86_IA32_MACOSX_USER 3
960 #define DEBUGGER_ID_ARM_IPHONE_USER 5
961 #define DEBUGGER_ID_X86_IA32_BOCHS 6
962 #define DEBUGGER_ID_6811_EMULATOR 7
963 #define DEBUGGER_ID_GDB_USER 8
964 #define DEBUGGER_ID_WINDBG 9
965 #define DEBUGGER_ID_X86_DOSBOX_EMULATOR 10
966 #define DEBUGGER_ID_ARM_LINUX_USER 11
967 #define DEBUGGER_ID_TRACE_REPLAYER 12
968 #define DEBUGGER_ID_X86_PIN_TRACER 14
969 #define DEBUGGER_ID_DALVIK_USER 15
970 #define DEBUGGER_ID_XNU_USER 16
971 #define DEBUGGER_ID_ARM_MACOS_USER 17
973
974 const char *processor;
977
980
984 #define DBG_FLAG_REMOTE 0x0000000000000001ULL
985 #define DBG_FLAG_NOHOST 0x0000000000000002ULL
987 #define DBG_FLAG_FAKE_ATTACH 0x0000000000000004ULL
989 #define DBG_FLAG_HWDATBPT_ONE 0x0000000000000008ULL
991 #define DBG_FLAG_CAN_CONT_BPT 0x0000000000000010ULL
994 #define DBG_FLAG_NEEDPORT 0x0000000000000020ULL
995 #define DBG_FLAG_DONT_DISTURB 0x0000000000000040ULL
1002 #define DBG_FLAG_SAFE 0x0000000000000080ULL
1004 #define DBG_FLAG_CLEAN_EXIT 0x0000000000000100ULL
1008 #define DBG_FLAG_USE_SREGS 0x0000000000000200ULL
1009 #define DBG_FLAG_NOSTARTDIR 0x0000000000000400ULL
1010 #define DBG_FLAG_NOPARAMETERS 0x0000000000000800ULL
1011 #define DBG_FLAG_NOPASSWORD 0x0000000000001000ULL
1012 #define DBG_FLAG_CONNSTRING 0x0000000000002000ULL
1013 #define DBG_FLAG_SMALLBLKS 0x0000000000004000ULL
1015 #define DBG_FLAG_MANMEMINFO 0x0000000000008000ULL
1018 #define DBG_FLAG_EXITSHOTOK 0x0000000000010000ULL
1019 #define DBG_FLAG_VIRTHREADS 0x0000000000020000ULL
1021 #define DBG_FLAG_LOWCNDS 0x0000000000040000ULL
1022 #define DBG_FLAG_DEBTHREAD 0x0000000000080000ULL
1029 #define DBG_FLAG_DEBUG_DLL 0x0000000000100000ULL
1031 #define DBG_FLAG_FAKE_MEMORY 0x0000000000200000ULL
1035 #define DBG_FLAG_ANYSIZE_HWBPT 0x0000000000400000ULL
1036 #define DBG_FLAG_TRACER_MODULE 0x0000000000800000ULL
1037 #define DBG_FLAG_PREFER_SWBPTS 0x0000000001000000ULL
1038 #define DBG_FLAG_LAZY_WATCHPTS 0x0000000002000000ULL
1041 #define DBG_FLAG_FAST_STEP 0x0000000004000000ULL
1042 #define DBG_FLAG_ADD_ENVS 0x0000000008000000ULL
1043 #define DBG_FLAG_MERGE_ENVS 0x0000000010000000ULL
1045 #define DBG_FLAG_DISABLE_ASLR 0x0000000020000000ULL
1047 #define DBG_FLAG_TTD 0x0000000040000000ULL
1048 #define DBG_FLAG_FULL_INSTR_BPT 0x0000000080000000ULL
1049 #define DBG_HAS_GET_PROCESSES 0x0000000100000000ULL
1050 #define DBG_HAS_ATTACH_PROCESS 0x0000000200000000ULL
1051 #define DBG_HAS_DETACH_PROCESS 0x0000000400000000ULL
1052 #define DBG_HAS_REQUEST_PAUSE 0x0000000800000000ULL
1053 #define DBG_HAS_SET_EXCEPTION_INFO \
1054 0x0000001000000000ULL
1055 #define DBG_HAS_THREAD_SUSPEND 0x0000002000000000ULL
1056 #define DBG_HAS_THREAD_CONTINUE 0x0000004000000000ULL
1057 #define DBG_HAS_SET_RESUME_MODE 0x0000008000000000ULL
1059 #define DBG_HAS_THREAD_GET_SREG_BASE \
1060 0x0000010000000000ULL
1061 #define DBG_HAS_CHECK_BPT 0x0000020000000000ULL
1062 #define DBG_HAS_OPEN_FILE 0x0000040000000000ULL
1063 #define DBG_HAS_UPDATE_CALL_STACK \
1064 0x0000080000000000ULL
1065 #define DBG_HAS_APPCALL 0x0000100000000000ULL
1066 #define DBG_HAS_REXEC 0x0000200000000000ULL
1067 #define DBG_HAS_MAP_ADDRESS 0x0000400000000000ULL
1071
1072 bool is_remote() const { return (flags & DBG_FLAG_REMOTE) != 0; }
1074 { return (flags & (DBG_FLAG_REMOTE|DBG_FLAG_NOHOST)) == DBG_FLAG_REMOTE; }
1076 { return (flags & DBG_FLAG_CAN_CONT_BPT) != 0; }
1077 bool may_disturb() const
1078 { return (flags & DBG_FLAG_DONT_DISTURB) == 0; }
1079 bool is_safe() const
1080 { return (flags & DBG_FLAG_SAFE) != 0; }
1081 bool use_sregs() const
1082 { return (flags & DBG_FLAG_USE_SREGS) != 0; }
1083 size_t cache_block_size() const
1084 { return (flags & DBG_FLAG_SMALLBLKS) != 0 ? 256 : 1024; }
1085 bool use_memregs() const
1086 { return (flags & DBG_FLAG_MANMEMINFO) != 0; }
1088 { return (flags & DBG_FLAG_EXITSHOTOK) != 0; }
1089 bool virtual_threads() const
1090 { return (flags & DBG_FLAG_VIRTHREADS) != 0; }
1091 bool supports_lowcnds() const
1092 { return (flags & DBG_FLAG_LOWCNDS) != 0; }
1094 { return (flags & DBG_FLAG_DEBTHREAD) != 0; }
1096 { return (flags & DBG_FLAG_DEBUG_DLL) != 0; }
1097 bool fake_memory() const
1098 { return (flags & DBG_FLAG_FAKE_MEMORY) != 0; }
1099 bool is_ttd() const
1100 { return (flags & DBG_FLAG_TTD) != 0; }
1101
1103 { return (flags & DBG_HAS_GET_PROCESSES) != 0; }
1105 { return (flags & DBG_HAS_ATTACH_PROCESS) != 0; }
1107 { return (flags & DBG_HAS_DETACH_PROCESS) != 0; }
1109 { return (flags & DBG_HAS_REQUEST_PAUSE) != 0; }
1111 { return (flags & DBG_HAS_SET_EXCEPTION_INFO) != 0; }
1113 { return (flags & DBG_HAS_THREAD_SUSPEND) != 0; }
1115 { return (flags & DBG_HAS_THREAD_CONTINUE) != 0; }
1117 { return (flags & DBG_HAS_SET_RESUME_MODE) != 0; }
1119 { return (flags & DBG_HAS_THREAD_GET_SREG_BASE) != 0; }
1120 bool has_check_bpt() const
1121 { return (flags & DBG_HAS_CHECK_BPT) != 0; }
1122 bool has_open_file() const
1123 { return (flags & DBG_HAS_OPEN_FILE) != 0; }
1125 { return (flags & DBG_HAS_UPDATE_CALL_STACK) != 0; }
1126 bool has_appcall() const
1127 { return (flags & DBG_HAS_APPCALL) != 0; }
1128 bool has_rexec() const
1129 { return (flags & DBG_HAS_REXEC) != 0; }
1130 bool has_map_address() const
1131 { return (flags & DBG_HAS_MAP_ADDRESS) != 0; }
1132 bool has_soft_bpt() const
1133 { return bpt_bytes != nullptr && bpt_size > 0; }
1134
1135 const char **regclasses;
1139
1140 // A function for accessing the 'registers' array
1141 inline register_info_t &regs(int idx)
1142 {
1143 return registers[idx];
1144 }
1145
1147
1156 #define DBG_RESMOD_STEP_INTO 0x0001
1157 #define DBG_RESMOD_STEP_OVER 0x0002
1158 #define DBG_RESMOD_STEP_OUT 0x0004
1159 #define DBG_RESMOD_STEP_SRCINTO 0x0008
1160 #define DBG_RESMOD_STEP_SRCOVER 0x0010
1161 #define DBG_RESMOD_STEP_SRCOUT 0x0020
1162 #define DBG_RESMOD_STEP_USER 0x0040
1163 #define DBG_RESMOD_STEP_HANDLE 0x0080
1164 #define DBG_RESMOD_STEP_BACKINTO 0x0100
1166 bool is_resmod_avail(int resmod) const
1167 { return (resume_modes & (1 << (resmod - 1))) != 0; }
1168
1169#if !defined(_MSC_VER) // this compiler complains :(
1170 static const int default_port_number = 23946;
1171#define DEBUGGER_PORT_NUMBER debugger_t::default_port_number
1172#else
1173#define DEBUGGER_PORT_NUMBER 23946
1174#endif
1175
1678
1680 ssize_t notify(event_t event_code, ...)
1681 {
1682 va_list va;
1683 va_start(va, event_code);
1684 ssize_t code = invoke_callbacks(HT_IDD, event_code, va);
1685 va_end(va);
1686 return code;
1687 }
1688 drc_t notify_drc(event_t event_code, ...)
1689 {
1690 va_list va;
1691 va_start(va, event_code);
1692 drc_t code = drc_t(invoke_callbacks(HT_IDD, event_code, va));
1693 va_end(va);
1694 return code;
1695 }
1696
1700 #define DBG_PROC_IS_DLL 0x01
1701 #define DBG_PROC_IS_GUI 0x02
1702 #define DBG_PROC_32BIT 0x04
1703 #define DBG_PROC_64BIT 0x08
1704 #define DBG_NO_TRACE 0x10
1705 #define DBG_HIDE_WINDOW 0x20
1706 #define DBG_SUSPENDED 0x40
1707 #define DBG_NO_ASLR 0x80
1709
1713 #define BPT_OK 0
1714 #define BPT_INTERNAL_ERR 1
1715 #define BPT_BAD_TYPE 2
1716 #define BPT_BAD_ALIGN 3
1717 #define BPT_BAD_ADDR 4
1718 #define BPT_BAD_LEN 5
1719 #define BPT_TOO_MANY 6
1720 #define BPT_READ_ERROR 7
1721 #define BPT_WRITE_ERROR 8
1722 #define BPT_SKIP 9
1723 #define BPT_PAGE_OK 10
1725
1729 #define APPCALL_MANUAL 0x0001
1731 #define APPCALL_DEBEV 0x0002
1732 #define APPCALL_TIMEOUT 0x0004
1736 #define SET_APPCALL_TIMEOUT(msecs) ((uint(msecs) << 16)|APPCALL_TIMEOUT)
1738 #define GET_APPCALL_TIMEOUT(options) (uint(options) >> 16)
1740
1741 // Notification helpers, should be used instead of direct dbg->notify(...) calls
1742 inline bool init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf=nullptr);
1743 inline bool term_debugger();
1744 inline drc_t get_processes(procinfo_vec_t *procs, qstring *errbuf=nullptr);
1745 inline drc_t start_process(const char *path,
1746 const char *args,
1747 launch_env_t *envs,
1748 const char *startdir,
1749 uint32 dbg_proc_flags,
1750 const char *input_path,
1751 uint32 input_file_crc32,
1752 qstring *errbuf=nullptr);
1753 inline drc_t attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf=nullptr);
1754 inline drc_t detach_process(qstring *errbuf=nullptr);
1755 inline bool get_debapp_attrs(debapp_attrs_t *out_pattrs);
1756 inline void rebase_if_required_to(ea_t new_base);
1757 inline drc_t request_pause(qstring *errbuf=nullptr);
1758 inline drc_t exit_process(qstring *errbuf=nullptr);
1759 inline gdecode_t get_debug_event(debug_event_t *event, int timeout_ms);
1760 inline drc_t resume(const debug_event_t *event, qstring *errbuf=nullptr);
1761 inline drc_t set_backwards(bool backwards);
1762 inline void set_exception_info(const exception_info_t *info, int qty);
1763 inline void suspended(bool dlls_added, thread_name_vec_t *thr_names=nullptr);
1764 inline drc_t thread_suspend(thid_t tid, qstring *errbuf=nullptr);
1765 inline drc_t thread_continue(thid_t tid, qstring *errbuf=nullptr);
1766 inline drc_t set_resume_mode(thid_t tid, resume_mode_t resmod, qstring *errbuf=nullptr);
1767 inline drc_t read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf=nullptr);
1768 inline drc_t write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf=nullptr);
1769 inline drc_t thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf=nullptr);
1770 inline drc_t get_memory_info(meminfo_vec_t &ranges, qstring *errbuf=nullptr);
1771 inline drc_t read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf=nullptr);
1772 inline drc_t write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf=nullptr);
1773 inline drc_t check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len);
1774 inline drc_t update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf=nullptr);
1775 inline drc_t update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf=nullptr);
1776 inline int open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf=nullptr);
1777 inline void close_file(int fn);
1778 inline ssize_t read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf=nullptr);
1779 inline ssize_t write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf=nullptr);
1780 inline ea_t map_address(ea_t off, const regval_t *regs, int regnum);
1781 inline const void *get_debmod_extensions();
1782 inline drc_t update_call_stack(thid_t tid, call_stack_t *trace);
1783 inline ea_t appcall(
1784 ea_t func_ea,
1785 thid_t tid,
1786 const struct func_type_data_t *fti,
1787 int nargs,
1788 const struct regobjs_t *regargs,
1789 struct relobj_t *stkargs,
1790 struct regobjs_t *retregs,
1791 qstring *errbuf,
1792 debug_event_t *event,
1793 int options);
1794 inline drc_t cleanup_appcall(thid_t tid);
1795 inline drc_t eval_lowcnd(thid_t tid, ea_t ea, qstring *errbuf=nullptr);
1796 inline drc_t send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf=nullptr);
1797 inline bool dbg_enable_trace(thid_t tid, bool enable, int trace_flags);
1798 inline bool is_tracing_enabled(thid_t tid, int tracebit);
1799 inline int rexec(const char *cmdline);
1800 inline bool get_srcinfo_path(qstring *path, ea_t base);
1801 inline drc_t bin_search(
1802 ea_t *out,
1803 ea_t start_ea,
1804 ea_t end_ea,
1805 const compiled_binpat_vec_t &data,
1806 int srch_flags,
1807 qstring *errbuf=nullptr);
1809 inline drc_t set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value);
1810 inline bool have_set_options() const;
1811};
1812
1813
1814#define RQ_MASKING 0x0001
1816#define RQ_SUSPEND 0x0002
1818#define RQ_NOSUSP 0x0000
1819#define RQ_IGNWERR 0x0004
1820#define RQ_SILENT 0x0008
1821#define RQ_VERBOSE 0x0000
1822#define RQ_SWSCREEN 0x0010
1823#define RQ__NOTHRRF 0x0020
1824#define RQ_PROCEXIT 0x0040
1825#define RQ_IDAIDLE 0x0080
1826#define RQ_SUSPRUN 0x0100
1827#define RQ_RESUME 0x0200
1828#define RQ_RESMOD 0xF000
1829#define RQ_RESMOD_SHIFT 12
1830#define RQ_INTO (RESMOD_INTO << RQ_RESMOD_SHIFT)
1831#define RQ_BACKINTO (RESMOD_BACKINTO << RQ_RESMOD_SHIFT)
1832
1833inline bool debugger_t::init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf)
1834{
1835 return notify_drc(ev_init_debugger, hostname, portnum, password, errbuf) == DRC_OK;
1836}
1838{
1840}
1842{
1843 return notify_drc(ev_get_processes, procs, errbuf);
1844}
1846 const char *path,
1847 const char *args,
1848 launch_env_t *envs,
1849 const char *startdir,
1850 uint32 dbg_proc_flags,
1851 const char *input_path,
1852 uint32 input_file_crc32,
1853 qstring *errbuf)
1854{
1855 return notify_drc(ev_start_process, path, args, startdir, dbg_proc_flags, input_path, input_file_crc32, errbuf, envs);
1856}
1857inline drc_t debugger_t::attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf)
1858{
1859 return notify_drc(ev_attach_process, pid, event_id, dbg_proc_flags, errbuf);
1860}
1862{
1863 return notify_drc(ev_detach_process, errbuf);
1864}
1866{
1867 return notify_drc(ev_get_debapp_attrs, out_pattrs) != DRC_NONE;
1868}
1870{
1872}
1874{
1875 return notify_drc(ev_request_pause, errbuf);
1876}
1878{
1879 return notify_drc(ev_exit_process, errbuf);
1880}
1882{
1884 notify_drc(ev_get_debug_event, &code, event, timeout_ms);
1885 return code;
1886}
1887inline drc_t debugger_t::resume(const debug_event_t *event, qstring *errbuf)
1888{
1889 return notify_drc(ev_resume, event, errbuf);
1890}
1891inline drc_t debugger_t::set_backwards(bool backwards)
1892{
1893 return notify_drc(ev_set_backwards, backwards);
1894}
1895inline void debugger_t::set_exception_info(const exception_info_t *info, int qty)
1896{
1898}
1899inline void debugger_t::suspended(bool dlls_added, thread_name_vec_t *thr_names)
1900{
1901 notify_drc(ev_suspended, dlls_added, thr_names);
1902}
1904{
1905 return notify_drc(ev_thread_suspend, tid, errbuf);
1906}
1908{
1909 return notify_drc(ev_thread_continue, tid, errbuf);
1910}
1912{
1913 return notify_drc(ev_set_resume_mode, tid, resmod, errbuf);
1914}
1915inline drc_t debugger_t::read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf)
1916{
1917 return notify_drc(ev_read_registers, tid, clsmask, values, errbuf);
1918}
1919inline drc_t debugger_t::write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf)
1920{
1921 return notify_drc(ev_write_register, tid, regidx, value, errbuf);
1922}
1923inline drc_t debugger_t::thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf)
1924{
1925 return notify_drc(ev_thread_get_sreg_base, answer, tid, sreg_value, errbuf);
1926}
1928{
1929 return notify_drc(ev_get_memory_info, &ranges, errbuf);
1930}
1931inline drc_t debugger_t::read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf)
1932{
1933 return notify_drc(ev_read_memory, nbytes, ea, buffer, size, errbuf);
1934}
1935inline drc_t debugger_t::write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf)
1936{
1937 return notify_drc(ev_write_memory, nbytes, ea, buffer, size, errbuf);
1938}
1939inline drc_t debugger_t::check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len)
1940{
1941 return notify_drc(ev_check_bpt, bptvc, type, ea, len);
1942}
1943inline drc_t debugger_t::update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf)
1944{
1945 return notify_drc(ev_update_bpts, nbpts, bpts, nadd, ndel, errbuf);
1946}
1947inline drc_t debugger_t::update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf)
1948{
1949 return notify_drc(ev_update_lowcnds, nupdated, lowcnds, nlowcnds, errbuf);
1950}
1951inline int debugger_t::open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf)
1952{
1953 return int(notify(ev_open_file, file, fsize, readonly, errbuf));
1954}
1955inline void debugger_t::close_file(int fn)
1956{
1957 notify(ev_close_file, fn);
1958}
1959inline ssize_t debugger_t::read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf)
1960{
1961 return notify(ev_read_file, fn, off, buf, size, errbuf);
1962}
1963inline ssize_t debugger_t::write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf)
1964{
1965 return notify(ev_write_file, fn, off, buf, size, errbuf);
1966}
1967inline ea_t debugger_t::map_address(ea_t off, const regval_t *rvs, int regnum)
1968{
1969 ea_t mapped;
1970 return notify_drc(ev_map_address, &mapped, off, rvs, regnum) == DRC_OK
1971 ? mapped
1972 : off;
1973}
1975{
1976 void *ext;
1978 ext = nullptr;
1979 return ext;
1980}
1982{
1983 return notify_drc(ev_update_call_stack, tid, trace);
1984}
1986 ea_t func_ea,
1987 thid_t tid,
1988 const struct func_type_data_t *fti,
1989 int nargs,
1990 const struct regobjs_t *regargs,
1991 struct relobj_t *stkargs,
1992 struct regobjs_t *retregs,
1993 qstring *errbuf,
1994 debug_event_t *event,
1995 int options)
1996{
1997 ea_t blob_ea;
1998 if ( notify_drc(ev_appcall, &blob_ea, func_ea, tid, fti, nargs, regargs, stkargs, retregs, errbuf, event, options) != DRC_OK )
1999 {
2000 blob_ea = BADADDR;
2001 if ( errbuf != nullptr )
2002 *errbuf = "Debugger plugin does not support an application function call";
2003 }
2004 return blob_ea;
2005}
2007{
2008 return notify_drc(ev_cleanup_appcall, tid);
2009}
2011{
2012 return notify_drc(ev_eval_lowcnd, tid, ea, errbuf);
2013}
2014inline drc_t debugger_t::send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf)
2015{
2016 return notify_drc(ev_send_ioctl, fn, buf, size, poutbuf, poutsize, errbuf);
2017}
2018inline bool debugger_t::dbg_enable_trace(thid_t tid, bool enable, int trace_flags)
2019{
2020 return notify_drc(ev_dbg_enable_trace, tid, enable, trace_flags) == DRC_OK;
2021}
2022inline bool debugger_t::is_tracing_enabled(thid_t tid, int tracebit)
2023{
2024 return notify_drc(ev_is_tracing_enabled, tid, tracebit) == DRC_OK;
2025}
2026inline int debugger_t::rexec(const char *cmdline)
2027{
2028 return int(notify(ev_rexec, cmdline));
2029}
2031{
2032 return notify_drc(ev_get_srcinfo_path, path, base) == DRC_OK;
2033}
2035 ea_t *out,
2036 ea_t start_ea,
2037 ea_t end_ea,
2038 const compiled_binpat_vec_t &data,
2039 int srch_flags,
2040 qstring *errbuf)
2041{
2042 return notify_drc(ev_bin_search, out, start_ea, end_ea, &data, srch_flags, errbuf);
2043}
2048inline drc_t debugger_t::set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value)
2049{
2050 return notify_drc(ev_set_dbg_options, res, keyword, pri, value_type, value);
2051}
2053{
2054 return const_cast<debugger_t *>(this)->notify_drc(ev_set_dbg_options, nullptr, " ", 0, 0, nullptr) != DRC_NONE;
2055}
2056
2062idaman int ida_export cpu2ieee(fpvalue_t *ieee_out, const void *cpu_fpval, int size);
2063
2069idaman int ida_export ieee2cpu(void *cpu_fpval_out, const fpvalue_t &ieee, int size);
2070
2071#endif // _IDD_HPP
qvector< compiled_binpat_t > compiled_binpat_vec_t
Definition bytes.hpp:2328
iterator begin(void)
Get a pointer to the beginning of the qstring.
Definition pro.h:3177
const qchar * c_str(void) const
Convert the qstring to a char *.
Definition pro.h:3170
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
void pack_dd(uint32 x)
Pack a dword and append the result to the bytevec.
Definition pro.h:3805
bytevec_t & append(const void *buf, size_t sz)
Append bytes to the bytevec.
Definition pro.h:3782
void pack_dq(uint64 x)
Pack a quadword and append the result to the bytevec.
Definition pro.h:3812
Class to hold idc values.
Definition expr.hpp:315
Reimplementation of vector class from STL.
Definition pro.h:2250
void resize(size_t _newsize, const T &x)
Resize to the given size.
Definition pro.h:2469
qvector(void)
Definition pro.h:2328
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2609
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2423
Primary mechanism for managing type information.
Definition typeinf.hpp:3046
const bpttype_t BPT_SOFT
Software breakpoint.
Definition idd.hpp:524
const bpttype_t BPT_WRITE
Write access.
Definition idd.hpp:521
const bpttype_t BPT_DEFAULT
Choose bpt type automatically.
Definition idd.hpp:526
const bpttype_t BPT_READ
Read access.
Definition idd.hpp:522
const bpttype_t BPT_EXEC
Execute instruction.
Definition idd.hpp:525
const bpttype_t BPT_RDWR
Read/write access.
Definition idd.hpp:523
bool idaapi exit_process(void)
Terminate the debugging of the current process.
Definition dbg.hpp:453
bool idaapi detach_process(void)
Detach the debugger from the debugged process.
Definition dbg.hpp:495
const debug_event_t *idaapi get_debug_event(void)
Get the current debugger event.
Definition dbg.hpp:2002
idaman THREAD_SAFE va_list va
See qsscanf()
Definition err.h:21
va_end(va)
THREAD_SAFE va_start(va, format)
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:997
const tinfo_t & type
Definition hexrays.hpp:7301
carglist_t * args
Definition hexrays.hpp:7323
@ HT_IDD
Hook to the debugger plugin.
Definition ida.hpp:1311
idaman ssize_t ida_export invoke_callbacks(hook_type_t hook_type, int notification_code, va_list va)
Generate event notification.
THREAD_SAFE void extract_regval(regval_t *out, T &v)
Definition idd.hpp:771
qvector< exception_info_t > excvec_t
vector of exception info objects
Definition idd.hpp:557
idaman THREAD_SAFE void ida_export set_debug_event_code(debug_event_t *ev, event_id_t id)
event_id_t
Debug event codes.
Definition idd.hpp:284
@ PROCESS_ATTACHED
Successfully attached to running process.
Definition idd.hpp:304
@ BITNESS_CHANGED
Debugger detected the process bitness changing.
Definition idd.hpp:317
@ STATUS_MASK
additional info about process state
Definition idd.hpp:316
@ TRACE_FULL
The trace buffer of the tracer module is full and IDA needs to read it before continuing.
Definition idd.hpp:313
@ PROCESS_EXITED
Process has been stopped.
Definition idd.hpp:289
@ LIB_UNLOADED
Library has been unloaded.
Definition idd.hpp:299
@ PROCESS_DETACHED
Successfully detached from process.
Definition idd.hpp:305
@ NO_EVENT
Not an interesting event.
Definition idd.hpp:285
@ BREAKPOINT
Breakpoint has been reached.
Definition idd.hpp:292
@ LIB_LOADED
New library has been loaded.
Definition idd.hpp:298
@ THREAD_STARTED
New thread has been started.
Definition idd.hpp:290
@ EXCEPTION
Exception.
Definition idd.hpp:297
@ PROCESS_SUSPENDED
Process has been suspended.
Definition idd.hpp:306
@ STEP
One instruction has been executed.
Definition idd.hpp:295
@ THREAD_EXITED
Thread has been stopped.
Definition idd.hpp:291
@ INFORMATION
User-defined information.
Definition idd.hpp:300
@ PROCESS_STARTED
New process has been started.
Definition idd.hpp:288
idaman THREAD_SAFE void ida_export deserialize_dynamic_register_set(dynamic_register_set_t *idaregs, memory_deserializer_t &mmdsr)
drc_t
Debugger return codes.
Definition idd.hpp:926
@ DRC_NETERR
network error
Definition idd.hpp:932
@ DRC_CRC
success, but the input file crc does not match
Definition idd.hpp:928
@ DRC_FAILED
failed or false
Definition idd.hpp:931
@ DRC_OK
success
Definition idd.hpp:929
@ DRC_NOFILE
file not found
Definition idd.hpp:933
@ DRC_IDBSEG
use idb segmentation
Definition idd.hpp:934
@ DRC_NONE
reaction to the event not implemented
Definition idd.hpp:930
@ DRC_NOPROC
the process does not exist anymore
Definition idd.hpp:935
@ DRC_NOCHG
no changes
Definition idd.hpp:936
@ DRC_ERROR
unclassified error, may be complemented by errbuf
Definition idd.hpp:937
@ DRC_EVENTS
success, there are pending events
Definition idd.hpp:927
idaman THREAD_SAFE void ida_export serialize_insn(bytevec_t *s, const insn_t &insn)
resume_mode_t
How to resume the application.
Definition idd.hpp:901
@ RESMOD_NONE
no stepping, run freely
Definition idd.hpp:902
@ RESMOD_OUT
step out of the current function (run until return)
Definition idd.hpp:905
@ RESMOD_SRCOUT
next source line in the previous stack frame
Definition idd.hpp:908
@ RESMOD_MAX
Definition idd.hpp:912
@ RESMOD_BACKINTO
step backwards into call (in time-travel debugging)
Definition idd.hpp:911
@ RESMOD_SRCOVER
next source line in the current stack frame
Definition idd.hpp:907
@ RESMOD_SRCINTO
until control reaches a different source line
Definition idd.hpp:906
@ RESMOD_OVER
step over call
Definition idd.hpp:904
@ RESMOD_USER
step out to the user code
Definition idd.hpp:909
@ RESMOD_HANDLE
step into the exception handler
Definition idd.hpp:910
@ RESMOD_INTO
step into call (the most typical single stepping)
Definition idd.hpp:903
int pid_t
process id
Definition idd.hpp:34
THREAD_SAFE void extract_regvals(regval_t *values, int n, T &v, const uchar *regmap)
Definition idd.hpp:790
qvector< update_bpt_info_t > update_bpt_vec_t
vector of update breakpoint info objects
Definition idd.hpp:870
DECLARE_TYPE_AS_MOVABLE(process_info_t)
int thid_t
thread id
Definition idd.hpp:35
idaman int ida_export ieee2cpu(void *cpu_fpval_out, const fpvalue_t &ieee, int size)
Convert a floating point number in IDA's internal format to CPU native format.
THREAD_SAFE void unpack_regvals(regval_t *values, int n, const uchar *regmap, memory_deserializer_t &mmdsr)
Definition idd.hpp:802
unsigned char register_class_t
Each register is associated to a register class.
Definition idd.hpp:89
gdecode_t
Return values for get_debug_event()
Definition idd.hpp:844
@ GDE_ERROR
error
Definition idd.hpp:845
@ GDE_MANY_EVENTS
got one event, more events available
Definition idd.hpp:848
@ GDE_NO_EVENT
no debug events are available
Definition idd.hpp:846
@ GDE_ONE_EVENT
got one event, no more available yet
Definition idd.hpp:847
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
THREAD_SAFE void append_regval(bytevec_t &s, const regval_t &value)
Definition idd.hpp:754
qvector< scattered_segm_t > scattered_image_t
vector of scattered segments
Definition idd.hpp:268
qvector< thread_name_t > thread_name_vec_t
vector of thread names
Definition idd.hpp:895
qvector< lowcnd_t > lowcnd_vec_t
vector of low-level breakpoint conditions
Definition idd.hpp:886
idaman error_t ida_export cleanup_appcall(thid_t tid)
Cleanup after manual appcall.
const char * get_debug_event_name(const debug_event_t &dev)
get debug event name
Definition idd.hpp:492
idaman THREAD_SAFE void ida_export deserialize_insn(insn_t *insn, memory_deserializer_t &mmdsr)
qvector< register_info_t > register_info_vec_t
Definition idd.hpp:121
idaman THREAD_SAFE void ida_export free_debug_event(debug_event_t *ev)
qvector< modinfo_t > modinfovec_t
Definition idd.hpp:336
qvector< regval_t > regvals_t
vector register value objects
Definition idd.hpp:721
idaman error_t ida_export dbg_appcall(idc_value_t *retval, ea_t func_ea, thid_t tid, const tinfo_t *ptif, idc_value_t *argv, size_t argnum)
Call a function from the debugged application.
idaman int ida_export cpu2ieee(fpvalue_t *ieee_out, const void *cpu_fpval, int size)
Convert a floating point number in CPU native format to IDA's internal format.
idaman THREAD_SAFE void ida_export copy_debug_event(debug_event_t *ev, const debug_event_t &r)
idaman THREAD_SAFE void ida_export serialize_dynamic_register_set(bytevec_t *buf, dynamic_register_set_t &idaregs)
char * answer
Definition kernwin.hpp:8023
int nbytes
Definition kernwin.hpp:2861
uval_t uval_t
Definition kernwin.hpp:1878
idaman size_t len
Definition kernwin.hpp:1356
asize_t size
Definition kernwin.hpp:6339
unsigned __int64 uint64
Definition llong.hpp:13
THREAD_SAFE void * extract_obj(T &v, void *destbuf, size_t destsize)
Definition pro.h:1996
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
uint64 asize_t
Definition pro.h:423
uint8 op_dtype_t
Definition pro.h:460
uint64 ea_t
Definition pro.h:421
THREAD_SAFE uint32 extract_dd(T &v)
Definition pro.h:2015
int int32
signed 32 bit value
Definition pro.h:347
struct bytevec_tag bytevec_t
Definition pro.h:4665
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1715
THREAD_SAFE uint64 extract_dq(T &v)
Definition pro.h:2026
unsigned int uint
unsigned 32 bit value
Definition pro.h:339
int error_t
Error code (errno)
Definition pro.h:458
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
INLINE THREAD_SAFE bool idaapi test_bit(const uchar *bitmap, size_t bit)
Test if 'bit' is set in 'bitmap'.
Definition pro.h:1364
unsigned short ushort
unsigned 16 bit value
Definition pro.h:338
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' if not zero.
Definition pro.h:1527
_qstring< char > qstring
regular string
Definition pro.h:3694
qvector< qstring > qstrvec_t
vector of strings
Definition pro.h:3697
Contains the definition of range_t.
Describes a breakpoint event.
Definition idd.hpp:341
ea_t kea
Address of the triggered bpt from the kernel's point of view.
Definition idd.hpp:343
ea_t hea
Possible address referenced by hardware breakpoints.
Definition idd.hpp:342
Call stack trace information.
Definition idd.hpp:735
bool operator==(const call_stack_info_t &r) const
Definition idd.hpp:741
ea_t callea
the address of the call instruction.
Definition idd.hpp:736
bool funcok
is the function present?
Definition idd.hpp:740
bool operator!=(const call_stack_info_t &r) const
Definition idd.hpp:748
ea_t funcea
the address of the called function
Definition idd.hpp:738
ea_t fp
the value of the frame pointer of the called function
Definition idd.hpp:739
defined as struct so it can be forward-declared
Definition idd.hpp:751
Runtime attributes of the debugger/process.
Definition idd.hpp:58
qstring platform
platform name process is running/debugging under.
Definition idd.hpp:70
int is_be
Definition idd.hpp:79
debapp_attrs_t()
Definition idd.hpp:81
int32 cbsize
control field: size of this structure
Definition idd.hpp:59
int addrsize
address size of the process.
Definition idd.hpp:68
This structure is used only when detailed information about a debug event is needed.
Definition idd.hpp:362
modinfo_t & set_modinfo(event_id_t id)
Definition idd.hpp:448
int & exit_code()
THREAD_STARTED (thread name) LIB_UNLOADED (unloaded library name) INFORMATION (will be displayed in t...
Definition idd.hpp:416
void clear_all()
Definition idd.hpp:385
ea_t ea
Address where the event occurred.
Definition idd.hpp:365
const qstring & info() const
Definition idd.hpp:444
friend THREAD_SAFE void ida_export free_debug_event(debug_event_t *ev)
friend THREAD_SAFE void ida_export set_debug_event_code(debug_event_t *ev, event_id_t id)
excinfo_t & exc()
Definition idd.hpp:436
modinfo_t & modinfo()
Information that depends on the event code:
Definition idd.hpp:410
void set_bitness_changed(bool on=true)
Definition idd.hpp:405
thid_t tid
Thread where the event occurred.
Definition idd.hpp:364
~debug_event_t()
Definition idd.hpp:378
void clear()
clear the dependent information (see below), set event code to NO_EVENT
Definition idd.hpp:383
bool handled
Is event handled by the debugger?
Definition idd.hpp:366
pid_t pid
Process where the event occurred.
Definition idd.hpp:363
void set_eid(event_id_t id)
Set event code.
Definition idd.hpp:401
const modinfo_t & modinfo() const
Definition idd.hpp:442
const int & exit_code() const
Definition idd.hpp:443
event_id_t eid() const
Event code.
Definition idd.hpp:395
const bptaddr_t & bpt() const
Definition idd.hpp:445
debug_event_t & operator=(const debug_event_t &r)
Definition idd.hpp:379
qstring & set_info(event_id_t id)
Definition idd.hpp:460
qstring & info()
BREAKPOINT
Definition idd.hpp:424
excinfo_t & set_exception()
Definition idd.hpp:472
void set_exit_code(event_id_t id, int code)
Definition idd.hpp:454
bptaddr_t & bpt()
EXCEPTION
Definition idd.hpp:430
debug_event_t & copy(const debug_event_t &r)
Definition idd.hpp:380
const excinfo_t & exc() const
Definition idd.hpp:446
bool is_bitness_changed() const
process bitness
Definition idd.hpp:404
debug_event_t()
Definition idd.hpp:376
friend THREAD_SAFE void ida_export copy_debug_event(debug_event_t *ev, const debug_event_t &r)
debug_event_t(const debug_event_t &r)
Definition idd.hpp:377
ea_t bpt_ea() const
On some systems with special memory mappings the triggered ea might be different from the actual ea.
Definition idd.hpp:480
bptaddr_t & set_bpt()
Definition idd.hpp:466
This structure describes a debugger API module.
Definition idd.hpp:948
drc_t set_resume_mode(thid_t tid, resume_mode_t resmod, qstring *errbuf=nullptr)
Definition idd.hpp:1911
bool has_request_pause() const
Definition idd.hpp:1108
int version
Expected kernel version, should be IDD_INTERFACE_VERSION.
Definition idd.hpp:949
drc_t exit_process(qstring *errbuf=nullptr)
Definition idd.hpp:1877
int memory_page_size
Size of a memory page. Usually 4K.
Definition idd.hpp:1146
bool has_attach_process() const
Definition idd.hpp:1104
drc_t update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf=nullptr)
Definition idd.hpp:1943
drc_t set_backwards(bool backwards)
Definition idd.hpp:1891
bool has_set_resume_mode() const
Definition idd.hpp:1116
uchar filetype
Input file type for the instant debugger.
Definition idd.hpp:1150
const char * name
Short debugger name like win32 or linux.
Definition idd.hpp:951
bool supports_lowcnds() const
Definition idd.hpp:1091
void rebase_if_required_to(ea_t new_base)
Definition idd.hpp:1869
drc_t get_processes(procinfo_vec_t *procs, qstring *errbuf=nullptr)
Definition idd.hpp:1841
drc_t write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf=nullptr)
Definition idd.hpp:1919
bool has_get_processes() const
Definition idd.hpp:1102
bool must_have_hostname() const
Definition idd.hpp:1073
int default_regclasses
Mask of default printed register classes.
Definition idd.hpp:1136
ssize_t write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1963
bool has_rexec() const
Definition idd.hpp:1128
ssize_t read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1959
const char * processor
Required processor name.
Definition idd.hpp:974
bool has_check_bpt() const
Definition idd.hpp:1120
bool has_open_file() const
Definition idd.hpp:1122
int nregisters
Number of registers.
Definition idd.hpp:1138
static const int default_port_number
Definition idd.hpp:1170
bool has_map_address() const
Definition idd.hpp:1130
bool has_set_exception_info() const
Definition idd.hpp:1110
bool has_appcall() const
Definition idd.hpp:1126
bool supports_debthread() const
Definition idd.hpp:1093
bool fake_memory() const
Definition idd.hpp:1097
bool term_debugger()
Definition idd.hpp:1837
void set_exception_info(const exception_info_t *info, int qty)
Definition idd.hpp:1895
register_info_t & regs(int idx)
Definition idd.hpp:1141
bool is_remote() const
Definition idd.hpp:1072
drc_t thread_suspend(thid_t tid, qstring *errbuf=nullptr)
Definition idd.hpp:1903
bool has_detach_process() const
Definition idd.hpp:1106
drc_t notify_drc(event_t event_code,...)
Definition idd.hpp:1688
void suspended(bool dlls_added, thread_name_vec_t *thr_names=nullptr)
Definition idd.hpp:1899
void close_file(int fn)
Definition idd.hpp:1955
bool has_update_call_stack() const
Definition idd.hpp:1124
bool init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf=nullptr)
Definition idd.hpp:1833
ushort resume_modes
Resume modes
Definition idd.hpp:1152
bool is_tracing_enabled(thid_t tid, int tracebit)
Definition idd.hpp:2022
bool is_safe() const
Definition idd.hpp:1079
drc_t attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf=nullptr)
Definition idd.hpp:1857
bool have_set_options() const
Definition idd.hpp:2052
drc_t start_process(const char *path, const char *args, launch_env_t *envs, const char *startdir, uint32 dbg_proc_flags, const char *input_path, uint32 input_file_crc32, qstring *errbuf=nullptr)
Definition idd.hpp:1845
int open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf=nullptr)
Definition idd.hpp:1951
drc_t request_pause(qstring *errbuf=nullptr)
Definition idd.hpp:1873
drc_t send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf=nullptr)
Definition idd.hpp:2014
bool is_ttd() const
Definition idd.hpp:1099
bool get_debapp_attrs(debapp_attrs_t *out_pattrs)
Definition idd.hpp:1865
register_info_t * registers
Array of registers. Use regs() to access it.
Definition idd.hpp:1137
ea_t appcall(ea_t func_ea, thid_t tid, const struct func_type_data_t *fti, int nargs, const struct regobjs_t *regargs, struct relobj_t *stkargs, struct regobjs_t *retregs, qstring *errbuf, debug_event_t *event, int options)
Definition idd.hpp:1985
drc_t update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf=nullptr)
Definition idd.hpp:1947
bool has_thread_get_sreg_base() const
Definition idd.hpp:1118
drc_t check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len)
Definition idd.hpp:1939
const void * get_debmod_extensions()
Definition idd.hpp:1974
bool is_resmod_avail(int resmod) const
Definition idd.hpp:1166
drc_t cleanup_appcall(thid_t tid)
Definition idd.hpp:2006
bool get_dynamic_register_set(dynamic_register_set_t *regset)
Definition idd.hpp:2044
drc_t read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1931
const uchar * bpt_bytes
A software breakpoint instruction.
Definition idd.hpp:1148
drc_t set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value)
Definition idd.hpp:2048
drc_t read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf=nullptr)
Definition idd.hpp:1915
bool dbg_enable_trace(thid_t tid, bool enable, int trace_flags)
Definition idd.hpp:2018
drc_t thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf=nullptr)
Definition idd.hpp:1923
bool has_thread_suspend() const
Definition idd.hpp:1112
bool can_continue_from_bpt() const
Definition idd.hpp:1075
bool use_memregs() const
Definition idd.hpp:1085
const char ** regclasses
Array of register class names.
Definition idd.hpp:1135
bool get_srcinfo_path(qstring *path, ea_t base)
Definition idd.hpp:2030
drc_t eval_lowcnd(thid_t tid, ea_t ea, qstring *errbuf=nullptr)
Definition idd.hpp:2010
gdecode_t get_debug_event(debug_event_t *event, int timeout_ms)
Definition idd.hpp:1881
bool may_take_exit_snapshot() const
Definition idd.hpp:1087
ea_t map_address(ea_t off, const regval_t *regs, int regnum)
Definition idd.hpp:1967
drc_t detach_process(qstring *errbuf=nullptr)
Definition idd.hpp:1861
bool has_thread_continue() const
Definition idd.hpp:1114
drc_t write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1935
uchar bpt_size
Size of the software breakpoint instruction in bytes.
Definition idd.hpp:1149
bool can_debug_standalone_dlls() const
Definition idd.hpp:1095
drc_t bin_search(ea_t *out, ea_t start_ea, ea_t end_ea, const compiled_binpat_vec_t &data, int srch_flags, qstring *errbuf=nullptr)
Definition idd.hpp:2034
bool use_sregs() const
Definition idd.hpp:1081
int rexec(const char *cmdline)
Definition idd.hpp:2026
uint64 flags
Definition idd.hpp:978
int id
one of Debugger API module id
Definition idd.hpp:952
bool has_soft_bpt() const
Definition idd.hpp:1132
drc_t update_call_stack(thid_t tid, call_stack_t *trace)
Definition idd.hpp:1981
event_t
Callback notification codes.
Definition idd.hpp:1187
@ ev_get_processes
Return information about the running processes.
Definition idd.hpp:1208
@ ev_is_tracing_enabled
Is tracing enabled?
Definition idd.hpp:1621
@ ev_update_call_stack
Calculate the call stack trace for the given thread.
Definition idd.hpp:1534
@ ev_set_resume_mode
Specify resume action Available if DBG_HAS_SET_RESUME_MODE is set.
Definition idd.hpp:1352
@ ev_get_dynamic_register_set
Ask debuger to send dynamic register set.
Definition idd.hpp:1657
@ ev_appcall
Call application function.
Definition idd.hpp:1560
@ ev_get_srcinfo_path
Get the path to a file containing source debug info for the given module.
Definition idd.hpp:1637
@ ev_thread_continue
Resume a suspended thread Available if DBG_HAS_THREAD_CONTINUE is set.
Definition idd.hpp:1346
@ ev_cleanup_appcall
Cleanup after appcall().
Definition idd.hpp:1576
@ ev_rebase_if_required_to
Rebase database if the debugged program has been rebased by the system.
Definition idd.hpp:1257
@ ev_thread_get_sreg_base
Get information about the base of a segment register.
Definition idd.hpp:1386
@ ev_write_memory
Write process memory.
Definition idd.hpp:1420
@ ev_thread_suspend
Suspend a running thread Available if DBG_HAS_THREAD_SUSPEND is set.
Definition idd.hpp:1341
@ ev_get_memory_info
Get information on the memory ranges.
Definition idd.hpp:1400
@ ev_get_debapp_attrs
Retrieve process- and debugger-specific runtime attributes.
Definition idd.hpp:1251
@ ev_set_exception_info
Set exception handling.
Definition idd.hpp:1312
@ ev_attach_process
Attach to an existing running process.
Definition idd.hpp:1235
@ ev_read_file
Definition idd.hpp:1480
@ ev_send_ioctl
Perform a debugger-specific event.
Definition idd.hpp:1602
@ ev_check_bpt
Is it possible to set breakpoint?
Definition idd.hpp:1434
@ ev_update_bpts
Add/del breakpoints.
Definition idd.hpp:1445
@ ev_exit_process
Stop the process.
Definition idd.hpp:1280
@ ev_dbg_enable_trace
Enable/Disable tracing.
Definition idd.hpp:1612
@ ev_update_lowcnds
Update low-level (server side) breakpoint conditions.
Definition idd.hpp:1454
@ ev_write_register
Write one thread register.
Definition idd.hpp:1375
@ ev_set_dbg_options
Set debugger options (parameters that are specific to the debugger module).
Definition idd.hpp:1676
@ ev_read_memory
Read process memory.
Definition idd.hpp:1410
@ ev_read_registers
Read thread registers.
Definition idd.hpp:1365
@ ev_get_debug_event
Get a pending debug event and suspend the process.
Definition idd.hpp:1292
@ ev_detach_process
Detach from the debugged process.
Definition idd.hpp:1245
@ ev_init_debugger
Initialize debugger.
Definition idd.hpp:1195
@ ev_eval_lowcnd
Evaluate a low level breakpoint condition at 'ea'.
Definition idd.hpp:1591
@ ev_map_address
Map process address.
Definition idd.hpp:1507
@ ev_set_backwards
Set whether the debugger should continue backwards or forwards.
Definition idd.hpp:1304
@ ev_write_file
Definition idd.hpp:1488
@ ev_suspended
This event will be generated by the kernel each time it has suspended the debuggee process and refres...
Definition idd.hpp:1330
@ ev_rexec
Execute a command on the remote computer.
Definition idd.hpp:1627
@ ev_resume
Continue after handling the event.
Definition idd.hpp:1299
@ ev_open_file
Definition idd.hpp:1468
@ ev_request_pause
Prepare to pause the process.
Definition idd.hpp:1269
@ ev_get_debmod_extensions
Get pointer to debugger specific events.
Definition idd.hpp:1518
@ ev_start_process
Start an executable to debug.
Definition idd.hpp:1224
@ ev_term_debugger
Terminate debugger.
Definition idd.hpp:1200
@ ev_close_file
Definition idd.hpp:1472
@ ev_bin_search
Search for a binary pattern in the program.
Definition idd.hpp:1651
ssize_t notify(event_t event_code,...)
Event notification handler.
Definition idd.hpp:1680
drc_t thread_continue(thid_t tid, qstring *errbuf=nullptr)
Definition idd.hpp:1907
drc_t get_memory_info(meminfo_vec_t &ranges, qstring *errbuf=nullptr)
Definition idd.hpp:1927
bool may_disturb() const
Definition idd.hpp:1077
drc_t resume(const debug_event_t *event, qstring *errbuf=nullptr)
Definition idd.hpp:1887
bool virtual_threads() const
Definition idd.hpp:1089
size_t cache_block_size() const
Definition idd.hpp:1083
Definition idd.hpp:125
void set_regclasses(const char **register_classes, int default_regcls)
Definition idd.hpp:198
register_info_t * registers()
Definition idd.hpp:213
void add_register(const char *name, int flags, op_dtype_t dtype, register_class_t register_class, const char *const *bit_strings, uval_t bits_mask)
Definition idd.hpp:153
qstrvec_t strvec
Definition idd.hpp:129
size_t nregs() const
Definition idd.hpp:212
void clear()
Definition idd.hpp:135
const char ** regclasses()
Definition idd.hpp:214
int default_regclasses
Mask of default printed register classes, 1 is the general register set.
Definition idd.hpp:132
bool empty() const
Definition idd.hpp:211
qvector< const_char_vec_t > bit_strings_ptrs_vec
Definition idd.hpp:131
void add_register(const register_info_t &ri)
Definition idd.hpp:143
const_char_vec_t classname_ptrs
Definition idd.hpp:130
qvector< const char * > const_char_vec_t
Definition idd.hpp:126
register_info_vec_t ri_vec
Definition idd.hpp:128
Exception information.
Definition idd.hpp:531
bool break_on() const
Should we break on the exception?
Definition idd.hpp:544
uint code
exception code
Definition idd.hpp:532
qstring name
Exception standard name.
Definition idd.hpp:549
bool handle() const
Should we handle the exception?
Definition idd.hpp:547
exception_info_t()
Definition idd.hpp:552
qstring desc
Long message used to display info about the exception.
Definition idd.hpp:550
exception_info_t(uint _code, uint32 _flags, const char *_name, const char *_desc)
Definition idd.hpp:553
uint32 flags
Exception info flags
Definition idd.hpp:533
Describes an exception.
Definition idd.hpp:352
ea_t ea
Possible address referenced by the exception.
Definition idd.hpp:355
bool can_cont
Execution of the process can continue after this exception?
Definition idd.hpp:354
qstring info
Exception message.
Definition idd.hpp:356
uint32 code
Exception code.
Definition idd.hpp:353
Processor-independent representation of a floating point value.
Definition ieee.h:98
Function type information (see tinfo_t::get_func_details())
Definition typeinf.hpp:4753
Instruction operand information.
Definition idd.hpp:725
bool modified
the operand is modified (written) by the instruction
Definition idd.hpp:726
int value_size
size of the value in bytes
Definition idd.hpp:730
int debregidx
for custom data: index of the corresponding register in dbg->registers
Definition idd.hpp:729
regval_t value
operand value. custom data is represented by 'bytes'.
Definition idd.hpp:728
ea_t ea
operand address (BADADDR - no address)
Definition idd.hpp:727
Used by debugger modules to launching processes with environment variables.
Definition idd.hpp:277
bool merge
Definition idd.hpp:278
Input argument for update_lowcnds().
Definition idd.hpp:875
insn_t cmd
decoded instruction at 'ea' (used for processors without single step feature, e.g.
Definition idd.hpp:881
qstring cndbody
new condition.
Definition idd.hpp:877
bpttype_t type
existing breakpoint type
Definition idd.hpp:879
bool compiled
has 'cndbody' already been compiled?
Definition idd.hpp:883
int size
breakpoint size (if type!=BPT_SOFT)
Definition idd.hpp:884
bytevec_t orgbytes
original bytes (if type==BPT_SOFT)
Definition idd.hpp:880
ea_t ea
address of the condition
Definition idd.hpp:876
vector of memory info objects
Definition idd.hpp:260
Definition pro.h:4382
Used by debugger modules to report memory are information to IDA kernel.
Definition idd.hpp:239
uchar bitness
Number of bits in segment addresses (0-16bit, 1-32bit, 2-64bit)
Definition idd.hpp:244
ea_t sbase
Segment base (meaningful only for segmented architectures, e.g.
Definition idd.hpp:242
uchar perm
Memory range permissions (0-no information): see segment.hpp.
Definition idd.hpp:245
qstring sclass
Memory range class name.
Definition idd.hpp:241
qstring name
Memory range name.
Definition idd.hpp:240
bool operator!=(const memory_info_t &r) const
Definition idd.hpp:257
bool operator==(const memory_info_t &r) const
Definition idd.hpp:247
Describes a module load event.
Definition idd.hpp:329
asize_t size
module size. if unknown pass 0
Definition idd.hpp:332
ea_t rebase_to
if not BADADDR, then rebase the program to the specified address
Definition idd.hpp:333
qstring name
full name of the module
Definition idd.hpp:330
ea_t base
module base address. if unknown pass BADADDR
Definition idd.hpp:331
Process information.
Definition idd.hpp:47
pid_t pid
process id
Definition idd.hpp:48
qstring name
process name
Definition idd.hpp:49
ea_t end_ea
end_ea excluded
Definition range.hpp:38
ea_t start_ea
start_ea included
Definition range.hpp:37
range_t(ea_t ea1=0, ea_t ea2=0)
Definition range.hpp:39
Debuggee register information.
Definition idd.hpp:95
const char * name
Register name.
Definition idd.hpp:96
const char *const * bit_strings
strings corresponding to each bit of the register.
Definition idd.hpp:116
uchar register_class_mask
mask of register classes
Definition idd.hpp:114
uval_t default_bit_strings_mask
mask of default bits
Definition idd.hpp:118
uint32 flags
Register info attribute flags
Definition idd.hpp:97
op_dtype_t dtype
Register size (see Operand value types)
Definition idd.hpp:115
Definition typeinf.hpp:6044
Structure to hold a register value.
Definition idd.hpp:563
~regval_t()
Definition idd.hpp:598
void set_bytes(const bytevec_t &v, int _rvtype=0)
Set custom value with existing bytevec.
Definition idd.hpp:691
regval_t & operator=(const regval_t &r)
Assign this regval to the given value.
Definition idd.hpp:601
size_t get_data_size() const
Get size of value.
Definition idd.hpp:710
void _set_bytes(const bytevec_t &v, int _rvtype=0)
Use set_bytes(const bytevec_t &)
Definition idd.hpp:664
const bytevec_t & bytes() const
Get const custom value.
Definition idd.hpp:704
regval_t(const regval_t &r)
Definition idd.hpp:593
uint64 ival
RVT_INT.
Definition idd.hpp:578
bytevec_t & bytes()
Definition idd.hpp:702
void _set_bytes(const uchar *data, size_t size, int _rvtype=0)
Use set_bytes(const uchar *, size_t)
Definition idd.hpp:657
bool operator==(const regval_t &r) const
Compare two regvals with '=='.
Definition idd.hpp:633
void _set_int(uint64 x)
Use set_int()
Definition idd.hpp:653
void set_unavailable()
Mark as unavailable.
Definition idd.hpp:695
void set_bytes(const uchar *data, size_t size, int _rvtype=0)
Set custom regval with raw data.
Definition idd.hpp:689
void _set_unavailable()
Use set_unavailable()
Definition idd.hpp:679
void _set_float(const bytevec_t &v)
Use set_float()
Definition idd.hpp:655
bool operator!=(const regval_t &r) const
Compare two regvals with '!='.
Definition idd.hpp:647
uchar reserve[sizeof(bytevec_t)]
bytevec_t: custom data type (use bytes() to access it) RVT_FLOAT: floating point value in native CPU ...
Definition idd.hpp:580
void swap(regval_t &r)
Set this = r and r = this.
Definition idd.hpp:650
void * get_data()
Get pointer to value.
Definition idd.hpp:706
bool use_bytevec() const
Definition idd.hpp:587
void set_int(uint64 x)
Definition idd.hpp:685
void clear()
Clear register value.
Definition idd.hpp:623
bytevec_t & _set_bytes(int _rvtype)
Use set_bytes()
Definition idd.hpp:671
void set_float(const bytevec_t &v)
Set float value.
Definition idd.hpp:687
int32 rvtype
one of Register value types
Definition idd.hpp:572
regval_t()
Definition idd.hpp:588
bytevec_t & set_bytes(int _rvtype)
Initialize this regval to an empty custom value.
Definition idd.hpp:693
const void * get_data() const
Get const pointer to value.
Definition idd.hpp:708
Relocatable object.
Definition pro.h:4026
Used by debugger modules to keep track of images that are not mapped uniformly into memory.
Definition idd.hpp:264
qstring name
name of the segment
Definition idd.hpp:265
Output argument for ev_suspended New thread names.
Definition idd.hpp:891
qstring name
new thread name
Definition idd.hpp:893
thid_t tid
thread
Definition idd.hpp:892
Input argument for update_bpts()
Definition idd.hpp:853
ea_t ea
in: bpt address
Definition idd.hpp:854
pid_t pid
in: process id
Definition idd.hpp:860
bool operator==(const update_bpt_info_t &b) const
facilitate update_bpt_vec_t::find()
Definition idd.hpp:864
thid_t tid
in: thread id
Definition idd.hpp:861
int size
in: bpt size (only for hwbpts)
Definition idd.hpp:857
bytevec_t orgbytes
in(del), out(add): original bytes (only for swbpts)
Definition idd.hpp:855
bpttype_t type
in: bpt type
Definition idd.hpp:856
uchar code
in: 0.
Definition idd.hpp:858
Functions that deal with the disassembling of program instructions.