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-2026 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(uint32(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#ifndef IDA_DBG_VALIDATE_REG_IDX
941#define IDA_DBG_VALIDATE_REG_IDX(idx, n) ((void)0)
942#endif
943
944//====================================================================
952{
955 const char *name;
956 int id;
957
961 #define DEBUGGER_ID_X86_IA32_WIN32_USER 0
962 #define DEBUGGER_ID_X86_IA32_LINUX_USER 1
963 #define DEBUGGER_ID_X86_IA32_MACOSX_USER 3
964 #define DEBUGGER_ID_ARM_IPHONE_USER 5
965 #define DEBUGGER_ID_X86_IA32_BOCHS 6
966 #define DEBUGGER_ID_6811_EMULATOR 7
967 #define DEBUGGER_ID_GDB_USER 8
968 #define DEBUGGER_ID_WINDBG 9
969 #define DEBUGGER_ID_X86_DOSBOX_EMULATOR 10
970 #define DEBUGGER_ID_ARM_LINUX_USER 11
971 #define DEBUGGER_ID_TRACE_REPLAYER 12
972 #define DEBUGGER_ID_X86_PIN_TRACER 14
973 #define DEBUGGER_ID_DALVIK_USER 15
974 #define DEBUGGER_ID_XNU_USER 16
975 #define DEBUGGER_ID_ARM_MACOS_USER 17
977
978 const char *processor;
981
984
988 #define DBG_FLAG_REMOTE 0x0000000000000001ULL
989 #define DBG_FLAG_NOHOST 0x0000000000000002ULL
991 #define DBG_FLAG_FAKE_ATTACH 0x0000000000000004ULL
993 #define DBG_FLAG_HWDATBPT_ONE 0x0000000000000008ULL
995 #define DBG_FLAG_CAN_CONT_BPT 0x0000000000000010ULL
998 #define DBG_FLAG_NEEDPORT 0x0000000000000020ULL
999 #define DBG_FLAG_DONT_DISTURB 0x0000000000000040ULL
1006 #define DBG_FLAG_SAFE 0x0000000000000080ULL
1008 #define DBG_FLAG_CLEAN_EXIT 0x0000000000000100ULL
1012 #define DBG_FLAG_USE_SREGS 0x0000000000000200ULL
1013 #define DBG_FLAG_NOSTARTDIR 0x0000000000000400ULL
1014 #define DBG_FLAG_NOPARAMETERS 0x0000000000000800ULL
1015 #define DBG_FLAG_NOPASSWORD 0x0000000000001000ULL
1016 #define DBG_FLAG_CONNSTRING 0x0000000000002000ULL
1017 #define DBG_FLAG_SMALLBLKS 0x0000000000004000ULL
1019 #define DBG_FLAG_MANMEMINFO 0x0000000000008000ULL
1022 #define DBG_FLAG_EXITSHOTOK 0x0000000000010000ULL
1023 #define DBG_FLAG_VIRTHREADS 0x0000000000020000ULL
1025 #define DBG_FLAG_LOWCNDS 0x0000000000040000ULL
1026 #define DBG_FLAG_DEBTHREAD 0x0000000000080000ULL
1033 #define DBG_FLAG_DEBUG_DLL 0x0000000000100000ULL
1035 #define DBG_FLAG_FAKE_MEMORY 0x0000000000200000ULL
1039 #define DBG_FLAG_ANYSIZE_HWBPT 0x0000000000400000ULL
1040 #define DBG_FLAG_TRACER_MODULE 0x0000000000800000ULL
1041 #define DBG_FLAG_PREFER_SWBPTS 0x0000000001000000ULL
1042 #define DBG_FLAG_LAZY_WATCHPTS 0x0000000002000000ULL
1045 #define DBG_FLAG_FAST_STEP 0x0000000004000000ULL
1046 #define DBG_FLAG_ADD_ENVS 0x0000000008000000ULL
1047 #define DBG_FLAG_MERGE_ENVS 0x0000000010000000ULL
1049 #define DBG_FLAG_DISABLE_ASLR 0x0000000020000000ULL
1051 #define DBG_FLAG_TTD 0x0000000040000000ULL
1052 #define DBG_FLAG_FULL_INSTR_BPT 0x0000000080000000ULL
1053 #define DBG_HAS_GET_PROCESSES 0x0000000100000000ULL
1054 #define DBG_HAS_ATTACH_PROCESS 0x0000000200000000ULL
1055 #define DBG_HAS_DETACH_PROCESS 0x0000000400000000ULL
1056 #define DBG_HAS_REQUEST_PAUSE 0x0000000800000000ULL
1057 #define DBG_HAS_SET_EXCEPTION_INFO \
1058 0x0000001000000000ULL
1059 #define DBG_HAS_THREAD_SUSPEND 0x0000002000000000ULL
1060 #define DBG_HAS_THREAD_CONTINUE 0x0000004000000000ULL
1061 #define DBG_HAS_SET_RESUME_MODE 0x0000008000000000ULL
1063 #define DBG_HAS_THREAD_GET_SREG_BASE \
1064 0x0000010000000000ULL
1065 #define DBG_HAS_CHECK_BPT 0x0000020000000000ULL
1066 #define DBG_HAS_OPEN_FILE 0x0000040000000000ULL
1067 #define DBG_HAS_UPDATE_CALL_STACK \
1068 0x0000080000000000ULL
1069 #define DBG_HAS_APPCALL 0x0000100000000000ULL
1070 #define DBG_HAS_REXEC 0x0000200000000000ULL
1071 #define DBG_HAS_MAP_ADDRESS 0x0000400000000000ULL
1075
1076 bool is_remote() const { return (flags & DBG_FLAG_REMOTE) != 0; }
1078 { return (flags & (DBG_FLAG_REMOTE|DBG_FLAG_NOHOST)) == DBG_FLAG_REMOTE; }
1080 { return (flags & DBG_FLAG_CAN_CONT_BPT) != 0; }
1081 bool may_disturb() const
1082 { return (flags & DBG_FLAG_DONT_DISTURB) == 0; }
1083 bool is_safe() const
1084 { return (flags & DBG_FLAG_SAFE) != 0; }
1085 bool use_sregs() const
1086 { return (flags & DBG_FLAG_USE_SREGS) != 0; }
1087 size_t cache_block_size() const
1088 { return (flags & DBG_FLAG_SMALLBLKS) != 0 ? 256 : 1024; }
1089 bool use_memregs() const
1090 { return (flags & DBG_FLAG_MANMEMINFO) != 0; }
1092 { return (flags & DBG_FLAG_EXITSHOTOK) != 0; }
1093 bool virtual_threads() const
1094 { return (flags & DBG_FLAG_VIRTHREADS) != 0; }
1095 bool supports_lowcnds() const
1096 { return (flags & DBG_FLAG_LOWCNDS) != 0; }
1098 { return (flags & DBG_FLAG_DEBTHREAD) != 0; }
1100 { return (flags & DBG_FLAG_DEBUG_DLL) != 0; }
1101 bool fake_memory() const
1102 { return (flags & DBG_FLAG_FAKE_MEMORY) != 0; }
1103 bool is_ttd() const
1104 { return (flags & DBG_FLAG_TTD) != 0; }
1105
1107 { return (flags & DBG_HAS_GET_PROCESSES) != 0; }
1109 { return (flags & DBG_HAS_ATTACH_PROCESS) != 0; }
1111 { return (flags & DBG_HAS_DETACH_PROCESS) != 0; }
1113 { return (flags & DBG_HAS_REQUEST_PAUSE) != 0; }
1115 { return (flags & DBG_HAS_SET_EXCEPTION_INFO) != 0; }
1117 { return (flags & DBG_HAS_THREAD_SUSPEND) != 0; }
1119 { return (flags & DBG_HAS_THREAD_CONTINUE) != 0; }
1121 { return (flags & DBG_HAS_SET_RESUME_MODE) != 0; }
1123 { return (flags & DBG_HAS_THREAD_GET_SREG_BASE) != 0; }
1124 bool has_check_bpt() const
1125 { return (flags & DBG_HAS_CHECK_BPT) != 0; }
1126 bool has_open_file() const
1127 { return (flags & DBG_HAS_OPEN_FILE) != 0; }
1129 { return (flags & DBG_HAS_UPDATE_CALL_STACK) != 0; }
1130 bool has_appcall() const
1131 { return (flags & DBG_HAS_APPCALL) != 0; }
1132 bool has_rexec() const
1133 { return (flags & DBG_HAS_REXEC) != 0; }
1134 bool has_map_address() const
1135 { return (flags & DBG_HAS_MAP_ADDRESS) != 0; }
1136 bool has_soft_bpt() const
1137 { return bpt_bytes != nullptr && bpt_size > 0; }
1138
1139 const char **regclasses;
1143
1144 // A function for accessing the 'registers' array
1145 inline register_info_t &regs(int idx)
1146 {
1147 IDA_DBG_VALIDATE_REG_IDX(idx, nregisters);
1148 return registers[idx];
1149 }
1150
1152
1161 #define DBG_RESMOD_STEP_INTO 0x0001
1162 #define DBG_RESMOD_STEP_OVER 0x0002
1163 #define DBG_RESMOD_STEP_OUT 0x0004
1164 #define DBG_RESMOD_STEP_SRCINTO 0x0008
1165 #define DBG_RESMOD_STEP_SRCOVER 0x0010
1166 #define DBG_RESMOD_STEP_SRCOUT 0x0020
1167 #define DBG_RESMOD_STEP_USER 0x0040
1168 #define DBG_RESMOD_STEP_HANDLE 0x0080
1169 #define DBG_RESMOD_STEP_BACKINTO 0x0100
1171 bool is_resmod_avail(int resmod) const
1172 { return (resume_modes & (1 << (resmod - 1))) != 0; }
1173
1174#if !defined(_MSC_VER) // this compiler complains :(
1175 static const int default_port_number = 23946;
1176#define DEBUGGER_PORT_NUMBER debugger_t::default_port_number
1177#else
1178#define DEBUGGER_PORT_NUMBER 23946
1179#endif
1180
1683
1685 ssize_t notify(event_t event_code, ...)
1686 {
1687 va_list va;
1688 va_start(va, event_code);
1689 ssize_t code = invoke_callbacks(HT_IDD, event_code, va);
1690 va_end(va);
1691 return code;
1692 }
1693 drc_t notify_drc(event_t event_code, ...)
1694 {
1695 va_list va;
1696 va_start(va, event_code);
1697 drc_t code = drc_t(invoke_callbacks(HT_IDD, event_code, va));
1698 va_end(va);
1699 return code;
1700 }
1701
1705 #define DBG_PROC_IS_DLL 0x01
1706 #define DBG_PROC_IS_GUI 0x02
1707 #define DBG_PROC_32BIT 0x04
1708 #define DBG_PROC_64BIT 0x08
1709 #define DBG_NO_TRACE 0x10
1710 #define DBG_HIDE_WINDOW 0x20
1711 #define DBG_SUSPENDED 0x40
1712 #define DBG_NO_ASLR 0x80
1714
1718 #define BPT_OK 0
1719 #define BPT_INTERNAL_ERR 1
1720 #define BPT_BAD_TYPE 2
1721 #define BPT_BAD_ALIGN 3
1722 #define BPT_BAD_ADDR 4
1723 #define BPT_BAD_LEN 5
1724 #define BPT_TOO_MANY 6
1725 #define BPT_READ_ERROR 7
1726 #define BPT_WRITE_ERROR 8
1727 #define BPT_SKIP 9
1728 #define BPT_PAGE_OK 10
1730
1734 #define APPCALL_MANUAL 0x0001
1736 #define APPCALL_DEBEV 0x0002
1737 #define APPCALL_TIMEOUT 0x0004
1741 #define SET_APPCALL_TIMEOUT(msecs) ((uint(msecs) << 16)|APPCALL_TIMEOUT)
1743 #define GET_APPCALL_TIMEOUT(options) (uint(options) >> 16)
1745
1746 // Notification helpers, should be used instead of direct dbg->notify(...) calls
1747 inline bool init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf=nullptr);
1748 inline bool term_debugger();
1749 inline drc_t get_processes(procinfo_vec_t *procs, qstring *errbuf=nullptr);
1750 inline drc_t start_process(const char *path,
1751 const char *args,
1752 launch_env_t *envs,
1753 const char *startdir,
1754 uint32 dbg_proc_flags,
1755 const char *input_path,
1756 uint32 input_file_crc32,
1757 qstring *errbuf=nullptr);
1758 inline drc_t attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf=nullptr);
1759 inline drc_t detach_process(qstring *errbuf=nullptr);
1760 inline bool get_debapp_attrs(debapp_attrs_t *out_pattrs);
1761 inline void rebase_if_required_to(ea_t new_base);
1762 inline drc_t request_pause(qstring *errbuf=nullptr);
1763 inline drc_t exit_process(qstring *errbuf=nullptr);
1764 inline gdecode_t get_debug_event(debug_event_t *event, int timeout_ms);
1765 inline drc_t resume(const debug_event_t *event, qstring *errbuf=nullptr);
1766 inline drc_t set_backwards(bool backwards);
1767 inline void set_exception_info(const exception_info_t *info, int qty);
1768 inline void suspended(bool dlls_added, thread_name_vec_t *thr_names=nullptr);
1769 inline drc_t thread_suspend(thid_t tid, qstring *errbuf=nullptr);
1770 inline drc_t thread_continue(thid_t tid, qstring *errbuf=nullptr);
1771 inline drc_t set_resume_mode(thid_t tid, resume_mode_t resmod, qstring *errbuf=nullptr);
1772 inline drc_t read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf=nullptr);
1773 inline drc_t write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf=nullptr);
1774 inline drc_t thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf=nullptr);
1775 inline drc_t get_memory_info(meminfo_vec_t &ranges, qstring *errbuf=nullptr);
1776 inline drc_t read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf=nullptr);
1777 inline drc_t write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf=nullptr);
1778 inline drc_t check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len);
1779 inline drc_t update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf=nullptr);
1780 inline drc_t update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf=nullptr);
1781 inline int open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf=nullptr);
1782 inline void close_file(int fn);
1783 inline ssize_t read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf=nullptr);
1784 inline ssize_t write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf=nullptr);
1785 inline ea_t map_address(ea_t off, const regval_t *regs, int regnum);
1786 inline const void *get_debmod_extensions();
1787 inline drc_t update_call_stack(thid_t tid, call_stack_t *trace);
1788 inline ea_t appcall(
1789 ea_t func_ea,
1790 thid_t tid,
1791 const struct func_type_data_t *fti,
1792 int nargs,
1793 const struct regobjs_t *regargs,
1794 struct relobj_t *stkargs,
1795 struct regobjs_t *retregs,
1796 qstring *errbuf,
1797 debug_event_t *event,
1798 int options);
1799 inline drc_t cleanup_appcall(thid_t tid);
1800 inline drc_t eval_lowcnd(thid_t tid, ea_t ea, qstring *errbuf=nullptr);
1801 inline drc_t send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf=nullptr);
1802 inline bool dbg_enable_trace(thid_t tid, bool enable, int trace_flags);
1803 inline bool is_tracing_enabled(thid_t tid, int tracebit);
1804 inline int rexec(const char *cmdline);
1805 inline bool get_srcinfo_path(qstring *path, ea_t base);
1806 inline drc_t bin_search(
1807 ea_t *out,
1808 ea_t start_ea,
1809 ea_t end_ea,
1810 const compiled_binpat_vec_t &data,
1811 int srch_flags,
1812 qstring *errbuf=nullptr);
1814 inline drc_t set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value);
1815 inline bool have_set_options() const;
1816};
1817
1818
1819#define RQ_MASKING 0x0001
1821#define RQ_SUSPEND 0x0002
1823#define RQ_NOSUSP 0x0000
1824#define RQ_IGNWERR 0x0004
1825#define RQ_SILENT 0x0008
1826#define RQ_VERBOSE 0x0000
1827#define RQ_SWSCREEN 0x0010
1828#define RQ__NOTHRRF 0x0020
1829#define RQ_PROCEXIT 0x0040
1830#define RQ_IDAIDLE 0x0080
1831#define RQ_SUSPRUN 0x0100
1832#define RQ_RESUME 0x0200
1833#define RQ_RESMOD 0xF000
1834#define RQ_RESMOD_SHIFT 12
1835#define RQ_INTO (RESMOD_INTO << RQ_RESMOD_SHIFT)
1836#define RQ_BACKINTO (RESMOD_BACKINTO << RQ_RESMOD_SHIFT)
1837
1838inline bool debugger_t::init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf)
1839{
1840 return notify_drc(ev_init_debugger, hostname, portnum, password, errbuf) == DRC_OK;
1841}
1843{
1845}
1847{
1848 return notify_drc(ev_get_processes, procs, errbuf);
1849}
1851 const char *path,
1852 const char *args,
1853 launch_env_t *envs,
1854 const char *startdir,
1855 uint32 dbg_proc_flags,
1856 const char *input_path,
1857 uint32 input_file_crc32,
1858 qstring *errbuf)
1859{
1860 return notify_drc(ev_start_process, path, args, startdir, dbg_proc_flags, input_path, input_file_crc32, errbuf, envs);
1861}
1862inline drc_t debugger_t::attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf)
1863{
1864 return notify_drc(ev_attach_process, pid, event_id, dbg_proc_flags, errbuf);
1865}
1867{
1868 return notify_drc(ev_detach_process, errbuf);
1869}
1871{
1872 return notify_drc(ev_get_debapp_attrs, out_pattrs) != DRC_NONE;
1873}
1875{
1877}
1879{
1880 return notify_drc(ev_request_pause, errbuf);
1881}
1883{
1884 return notify_drc(ev_exit_process, errbuf);
1885}
1887{
1889 notify_drc(ev_get_debug_event, &code, event, timeout_ms);
1890 return code;
1891}
1892inline drc_t debugger_t::resume(const debug_event_t *event, qstring *errbuf)
1893{
1894 return notify_drc(ev_resume, event, errbuf);
1895}
1896inline drc_t debugger_t::set_backwards(bool backwards)
1897{
1898 return notify_drc(ev_set_backwards, backwards);
1899}
1900inline void debugger_t::set_exception_info(const exception_info_t *info, int qty)
1901{
1903}
1904inline void debugger_t::suspended(bool dlls_added, thread_name_vec_t *thr_names)
1905{
1906 notify_drc(ev_suspended, dlls_added, thr_names);
1907}
1909{
1910 return notify_drc(ev_thread_suspend, tid, errbuf);
1911}
1913{
1914 return notify_drc(ev_thread_continue, tid, errbuf);
1915}
1917{
1918 return notify_drc(ev_set_resume_mode, tid, resmod, errbuf);
1919}
1920inline drc_t debugger_t::read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf)
1921{
1922 return notify_drc(ev_read_registers, tid, clsmask, values, errbuf);
1923}
1924inline drc_t debugger_t::write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf)
1925{
1926 return notify_drc(ev_write_register, tid, regidx, value, errbuf);
1927}
1928inline drc_t debugger_t::thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf)
1929{
1930 return notify_drc(ev_thread_get_sreg_base, answer, tid, sreg_value, errbuf);
1931}
1933{
1934 return notify_drc(ev_get_memory_info, &ranges, errbuf);
1935}
1936inline drc_t debugger_t::read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf)
1937{
1938 return notify_drc(ev_read_memory, nbytes, ea, buffer, size, errbuf);
1939}
1940inline drc_t debugger_t::write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf)
1941{
1942 return notify_drc(ev_write_memory, nbytes, ea, buffer, size, errbuf);
1943}
1944inline drc_t debugger_t::check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len)
1945{
1946 return notify_drc(ev_check_bpt, bptvc, type, ea, len);
1947}
1948inline drc_t debugger_t::update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf)
1949{
1950 return notify_drc(ev_update_bpts, nbpts, bpts, nadd, ndel, errbuf);
1951}
1952inline drc_t debugger_t::update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf)
1953{
1954 return notify_drc(ev_update_lowcnds, nupdated, lowcnds, nlowcnds, errbuf);
1955}
1956inline int debugger_t::open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf)
1957{
1958 return int(notify(ev_open_file, file, fsize, readonly, errbuf));
1959}
1960inline void debugger_t::close_file(int fn)
1961{
1962 notify(ev_close_file, fn);
1963}
1964inline ssize_t debugger_t::read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf)
1965{
1966 return notify(ev_read_file, fn, off, buf, size, errbuf);
1967}
1968inline ssize_t debugger_t::write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf)
1969{
1970 return notify(ev_write_file, fn, off, buf, size, errbuf);
1971}
1972inline ea_t debugger_t::map_address(ea_t off, const regval_t *rvs, int regnum)
1973{
1974 ea_t mapped;
1975 return notify_drc(ev_map_address, &mapped, off, rvs, regnum) == DRC_OK
1976 ? mapped
1977 : off;
1978}
1980{
1981 void *ext;
1983 ext = nullptr;
1984 return ext;
1985}
1987{
1988 return notify_drc(ev_update_call_stack, tid, trace);
1989}
1991 ea_t func_ea,
1992 thid_t tid,
1993 const struct func_type_data_t *fti,
1994 int nargs,
1995 const struct regobjs_t *regargs,
1996 struct relobj_t *stkargs,
1997 struct regobjs_t *retregs,
1998 qstring *errbuf,
1999 debug_event_t *event,
2000 int options)
2001{
2002 ea_t blob_ea;
2003 if ( notify_drc(ev_appcall, &blob_ea, func_ea, tid, fti, nargs, regargs, stkargs, retregs, errbuf, event, options) != DRC_OK )
2004 {
2005 blob_ea = BADADDR;
2006 if ( errbuf != nullptr )
2007 *errbuf = "Debugger plugin does not support an application function call";
2008 }
2009 return blob_ea;
2010}
2012{
2013 return notify_drc(ev_cleanup_appcall, tid);
2014}
2016{
2017 return notify_drc(ev_eval_lowcnd, tid, ea, errbuf);
2018}
2019inline drc_t debugger_t::send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf)
2020{
2021 return notify_drc(ev_send_ioctl, fn, buf, size, poutbuf, poutsize, errbuf);
2022}
2023inline bool debugger_t::dbg_enable_trace(thid_t tid, bool enable, int trace_flags)
2024{
2025 return notify_drc(ev_dbg_enable_trace, tid, enable, trace_flags) == DRC_OK;
2026}
2027inline bool debugger_t::is_tracing_enabled(thid_t tid, int tracebit)
2028{
2029 return notify_drc(ev_is_tracing_enabled, tid, tracebit) == DRC_OK;
2030}
2031inline int debugger_t::rexec(const char *cmdline)
2032{
2033 return int(notify(ev_rexec, cmdline));
2034}
2036{
2037 return notify_drc(ev_get_srcinfo_path, path, base) == DRC_OK;
2038}
2040 ea_t *out,
2041 ea_t start_ea,
2042 ea_t end_ea,
2043 const compiled_binpat_vec_t &data,
2044 int srch_flags,
2045 qstring *errbuf)
2046{
2047 return notify_drc(ev_bin_search, out, start_ea, end_ea, &data, srch_flags, errbuf);
2048}
2053inline drc_t debugger_t::set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value)
2054{
2055 return notify_drc(ev_set_dbg_options, res, keyword, pri, value_type, value);
2056}
2058{
2059 return const_cast<debugger_t *>(this)->notify_drc(ev_set_dbg_options, nullptr, " ", 0, 0, nullptr) != DRC_NONE;
2060}
2061
2067idaman int ida_export cpu2ieee(fpvalue_t *ieee_out, const void *cpu_fpval, int size);
2068
2074idaman int ida_export ieee2cpu(void *cpu_fpval_out, const fpvalue_t &ieee, int size);
2075
2076#endif // _IDD_HPP
qvector< compiled_binpat_t > compiled_binpat_vec_t
Definition bytes.hpp:2370
iterator begin(void)
Get a pointer to the beginning of the qstring.
Definition pro.h:3253
const qchar * c_str(void) const
Convert the qstring to a char *.
Definition pro.h:3246
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
void pack_dd(uint32 x)
Pack a dword and append the result to the bytevec.
Definition pro.h:3882
bytevec_t & append(const void *buf, size_t sz)
Append bytes to the bytevec.
Definition pro.h:3859
void pack_dq(uint64 x)
Pack a quadword and append the result to the bytevec.
Definition pro.h:3889
Class to hold idc values.
Definition expr.hpp:315
Reimplementation of vector class from STL.
Definition pro.h:2262
void resize(size_t _newsize, const T &x)
Resize to the given size.
Definition pro.h:2540
qvector(void)
Definition pro.h:2374
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2683
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2494
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
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:2016
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:1000
const tinfo_t & type
Definition hexrays.hpp:7698
carglist_t * args
Definition hexrays.hpp:7720
@ HT_IDD
Hook to the debugger plugin.
Definition ida.hpp:1328
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:8465
int nbytes
Definition kernwin.hpp:3037
uval_t uval_t
Definition kernwin.hpp:1926
idaman size_t len
Definition kernwin.hpp:1389
asize_t size
Definition kernwin.hpp:6701
unsigned __int64 uint64
Definition llong.hpp:13
qvector< qstring > qstrvec_t
Definition lumina.hpp:831
THREAD_SAFE void * extract_obj(T &v, void *destbuf, size_t destsize)
Definition pro.h:2012
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
uint64 asize_t
Definition pro.h:427
uint8 op_dtype_t
Definition pro.h:464
uint64 ea_t
Definition pro.h:425
THREAD_SAFE uint32 extract_dd(T &v)
Definition pro.h:2031
int int32
signed 32 bit value
Definition pro.h:351
struct bytevec_tag bytevec_t
Definition pro.h:4762
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1728
THREAD_SAFE uint64 extract_dq(T &v)
Definition pro.h:2042
unsigned int uint
unsigned 32 bit value
Definition pro.h:343
int error_t
Error code (errno)
Definition pro.h:462
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
INLINE THREAD_SAFE bool idaapi test_bit(const uchar *bitmap, size_t bit)
Test if 'bit' is set in 'bitmap'.
Definition pro.h:1367
unsigned short ushort
unsigned 16 bit value
Definition pro.h:342
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' is not zero.
Definition pro.h:1530
_qstring< char > qstring
regular string
Definition pro.h:3771
unsigned int
Definition pronet.h:99
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:952
drc_t set_resume_mode(thid_t tid, resume_mode_t resmod, qstring *errbuf=nullptr)
Definition idd.hpp:1916
bool has_request_pause() const
Definition idd.hpp:1112
int version
Expected kernel version, should be IDD_INTERFACE_VERSION.
Definition idd.hpp:953
drc_t exit_process(qstring *errbuf=nullptr)
Definition idd.hpp:1882
int memory_page_size
Size of a memory page. Usually 4K.
Definition idd.hpp:1151
bool has_attach_process() const
Definition idd.hpp:1108
drc_t update_bpts(int *nbpts, update_bpt_info_t *bpts, int nadd, int ndel, qstring *errbuf=nullptr)
Definition idd.hpp:1948
drc_t set_backwards(bool backwards)
Definition idd.hpp:1896
bool has_set_resume_mode() const
Definition idd.hpp:1120
uchar filetype
Input file type for the instant debugger.
Definition idd.hpp:1155
const char * name
Short debugger name like win32 or linux.
Definition idd.hpp:955
bool supports_lowcnds() const
Definition idd.hpp:1095
void rebase_if_required_to(ea_t new_base)
Definition idd.hpp:1874
drc_t get_processes(procinfo_vec_t *procs, qstring *errbuf=nullptr)
Definition idd.hpp:1846
drc_t write_register(thid_t tid, int regidx, const regval_t *value, qstring *errbuf=nullptr)
Definition idd.hpp:1924
bool has_get_processes() const
Definition idd.hpp:1106
bool must_have_hostname() const
Definition idd.hpp:1077
int default_regclasses
Mask of default printed register classes.
Definition idd.hpp:1140
ssize_t write_file(int fn, qoff64_t off, const void *buf, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1968
bool has_rexec() const
Definition idd.hpp:1132
ssize_t read_file(int fn, qoff64_t off, void *buf, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1964
const char * processor
Required processor name.
Definition idd.hpp:978
bool has_check_bpt() const
Definition idd.hpp:1124
bool has_open_file() const
Definition idd.hpp:1126
int nregisters
Number of registers.
Definition idd.hpp:1142
static const int default_port_number
Definition idd.hpp:1175
bool has_map_address() const
Definition idd.hpp:1134
bool has_set_exception_info() const
Definition idd.hpp:1114
bool has_appcall() const
Definition idd.hpp:1130
bool supports_debthread() const
Definition idd.hpp:1097
bool fake_memory() const
Definition idd.hpp:1101
bool term_debugger()
Definition idd.hpp:1842
void set_exception_info(const exception_info_t *info, int qty)
Definition idd.hpp:1900
register_info_t & regs(int idx)
Definition idd.hpp:1145
bool is_remote() const
Definition idd.hpp:1076
drc_t thread_suspend(thid_t tid, qstring *errbuf=nullptr)
Definition idd.hpp:1908
bool has_detach_process() const
Definition idd.hpp:1110
drc_t notify_drc(event_t event_code,...)
Definition idd.hpp:1693
void suspended(bool dlls_added, thread_name_vec_t *thr_names=nullptr)
Definition idd.hpp:1904
void close_file(int fn)
Definition idd.hpp:1960
bool has_update_call_stack() const
Definition idd.hpp:1128
bool init_debugger(const char *hostname, int portnum, const char *password, qstring *errbuf=nullptr)
Definition idd.hpp:1838
ushort resume_modes
Resume modes
Definition idd.hpp:1157
bool is_tracing_enabled(thid_t tid, int tracebit)
Definition idd.hpp:2027
bool is_safe() const
Definition idd.hpp:1083
drc_t attach_process(pid_t pid, int event_id, uint32 dbg_proc_flags, qstring *errbuf=nullptr)
Definition idd.hpp:1862
bool have_set_options() const
Definition idd.hpp:2057
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:1850
int open_file(const char *file, uint64 *fsize, bool readonly, qstring *errbuf=nullptr)
Definition idd.hpp:1956
drc_t request_pause(qstring *errbuf=nullptr)
Definition idd.hpp:1878
drc_t send_ioctl(int fn, const void *buf, size_t size, void **poutbuf, ssize_t *poutsize, qstring *errbuf=nullptr)
Definition idd.hpp:2019
bool is_ttd() const
Definition idd.hpp:1103
bool get_debapp_attrs(debapp_attrs_t *out_pattrs)
Definition idd.hpp:1870
register_info_t * registers
Array of registers. Use regs() to access it.
Definition idd.hpp:1141
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:1990
drc_t update_lowcnds(int *nupdated, const lowcnd_t *lowcnds, int nlowcnds, qstring *errbuf=nullptr)
Definition idd.hpp:1952
bool has_thread_get_sreg_base() const
Definition idd.hpp:1122
drc_t check_bpt(int *bptvc, bpttype_t type, ea_t ea, int len)
Definition idd.hpp:1944
const void * get_debmod_extensions()
Definition idd.hpp:1979
bool is_resmod_avail(int resmod) const
Definition idd.hpp:1171
drc_t cleanup_appcall(thid_t tid)
Definition idd.hpp:2011
bool get_dynamic_register_set(dynamic_register_set_t *regset)
Definition idd.hpp:2049
drc_t read_memory(size_t *nbytes, ea_t ea, void *buffer, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1936
const uchar * bpt_bytes
A software breakpoint instruction.
Definition idd.hpp:1153
drc_t set_dbg_options(const char **res, const char *keyword, int pri, int value_type, const void *value)
Definition idd.hpp:2053
drc_t read_registers(thid_t tid, int clsmask, regval_t *values, qstring *errbuf=nullptr)
Definition idd.hpp:1920
bool dbg_enable_trace(thid_t tid, bool enable, int trace_flags)
Definition idd.hpp:2023
drc_t thread_get_sreg_base(ea_t *answer, thid_t tid, int sreg_value, qstring *errbuf=nullptr)
Definition idd.hpp:1928
bool has_thread_suspend() const
Definition idd.hpp:1116
bool can_continue_from_bpt() const
Definition idd.hpp:1079
bool use_memregs() const
Definition idd.hpp:1089
const char ** regclasses
Array of register class names.
Definition idd.hpp:1139
bool get_srcinfo_path(qstring *path, ea_t base)
Definition idd.hpp:2035
drc_t eval_lowcnd(thid_t tid, ea_t ea, qstring *errbuf=nullptr)
Definition idd.hpp:2015
gdecode_t get_debug_event(debug_event_t *event, int timeout_ms)
Definition idd.hpp:1886
bool may_take_exit_snapshot() const
Definition idd.hpp:1091
ea_t map_address(ea_t off, const regval_t *regs, int regnum)
Definition idd.hpp:1972
drc_t detach_process(qstring *errbuf=nullptr)
Definition idd.hpp:1866
bool has_thread_continue() const
Definition idd.hpp:1118
drc_t write_memory(size_t *nbytes, ea_t ea, const void *buffer, size_t size, qstring *errbuf=nullptr)
Definition idd.hpp:1940
uchar bpt_size
Size of the software breakpoint instruction in bytes.
Definition idd.hpp:1154
bool can_debug_standalone_dlls() const
Definition idd.hpp:1099
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:2039
bool use_sregs() const
Definition idd.hpp:1085
int rexec(const char *cmdline)
Definition idd.hpp:2031
uint64 flags
Definition idd.hpp:982
int id
one of Debugger API module id
Definition idd.hpp:956
bool has_soft_bpt() const
Definition idd.hpp:1136
drc_t update_call_stack(thid_t tid, call_stack_t *trace)
Definition idd.hpp:1986
event_t
Callback notification codes.
Definition idd.hpp:1192
@ ev_get_processes
Return information about the running processes.
Definition idd.hpp:1213
@ ev_is_tracing_enabled
Is tracing enabled?
Definition idd.hpp:1626
@ ev_update_call_stack
Calculate the call stack trace for the given thread.
Definition idd.hpp:1539
@ ev_set_resume_mode
Specify resume action Available if DBG_HAS_SET_RESUME_MODE is set.
Definition idd.hpp:1357
@ ev_get_dynamic_register_set
Ask debuger to send dynamic register set.
Definition idd.hpp:1662
@ ev_appcall
Call application function.
Definition idd.hpp:1565
@ ev_get_srcinfo_path
Get the path to a file containing source debug info for the given module.
Definition idd.hpp:1642
@ ev_thread_continue
Resume a suspended thread Available if DBG_HAS_THREAD_CONTINUE is set.
Definition idd.hpp:1351
@ ev_cleanup_appcall
Cleanup after appcall().
Definition idd.hpp:1581
@ ev_rebase_if_required_to
Rebase database if the debugged program has been rebased by the system.
Definition idd.hpp:1262
@ ev_thread_get_sreg_base
Get information about the base of a segment register.
Definition idd.hpp:1391
@ ev_write_memory
Write process memory.
Definition idd.hpp:1425
@ ev_thread_suspend
Suspend a running thread Available if DBG_HAS_THREAD_SUSPEND is set.
Definition idd.hpp:1346
@ ev_get_memory_info
Get information on the memory ranges.
Definition idd.hpp:1405
@ ev_get_debapp_attrs
Retrieve process- and debugger-specific runtime attributes.
Definition idd.hpp:1256
@ ev_set_exception_info
Set exception handling.
Definition idd.hpp:1317
@ ev_attach_process
Attach to an existing running process.
Definition idd.hpp:1240
@ ev_read_file
Definition idd.hpp:1485
@ ev_send_ioctl
Perform a debugger-specific event.
Definition idd.hpp:1607
@ ev_check_bpt
Is it possible to set breakpoint?
Definition idd.hpp:1439
@ ev_update_bpts
Add/del breakpoints.
Definition idd.hpp:1450
@ ev_exit_process
Stop the process.
Definition idd.hpp:1285
@ ev_dbg_enable_trace
Enable/Disable tracing.
Definition idd.hpp:1617
@ ev_update_lowcnds
Update low-level (server side) breakpoint conditions.
Definition idd.hpp:1459
@ ev_write_register
Write one thread register.
Definition idd.hpp:1380
@ ev_set_dbg_options
Set debugger options (parameters that are specific to the debugger module).
Definition idd.hpp:1681
@ ev_read_memory
Read process memory.
Definition idd.hpp:1415
@ ev_read_registers
Read thread registers.
Definition idd.hpp:1370
@ ev_get_debug_event
Get a pending debug event and suspend the process.
Definition idd.hpp:1297
@ ev_detach_process
Detach from the debugged process.
Definition idd.hpp:1250
@ ev_init_debugger
Initialize debugger.
Definition idd.hpp:1200
@ ev_eval_lowcnd
Evaluate a low level breakpoint condition at 'ea'.
Definition idd.hpp:1596
@ ev_map_address
Map process address.
Definition idd.hpp:1512
@ ev_set_backwards
Set whether the debugger should continue backwards or forwards.
Definition idd.hpp:1309
@ ev_write_file
Definition idd.hpp:1493
@ ev_suspended
This event will be generated by the kernel each time it has suspended the debuggee process and refres...
Definition idd.hpp:1335
@ ev_rexec
Execute a command on the remote computer.
Definition idd.hpp:1632
@ ev_resume
Continue after handling the event.
Definition idd.hpp:1304
@ ev_open_file
Definition idd.hpp:1473
@ ev_request_pause
Prepare to pause the process.
Definition idd.hpp:1274
@ ev_get_debmod_extensions
Get pointer to debugger specific events.
Definition idd.hpp:1523
@ ev_start_process
Start an executable to debug.
Definition idd.hpp:1229
@ ev_term_debugger
Terminate debugger.
Definition idd.hpp:1205
@ ev_close_file
Definition idd.hpp:1477
@ ev_bin_search
Search for a binary pattern in the program.
Definition idd.hpp:1656
ssize_t notify(event_t event_code,...)
Event notification handler.
Definition idd.hpp:1685
drc_t thread_continue(thid_t tid, qstring *errbuf=nullptr)
Definition idd.hpp:1912
drc_t get_memory_info(meminfo_vec_t &ranges, qstring *errbuf=nullptr)
Definition idd.hpp:1932
bool may_disturb() const
Definition idd.hpp:1081
drc_t resume(const debug_event_t *event, qstring *errbuf=nullptr)
Definition idd.hpp:1892
bool virtual_threads() const
Definition idd.hpp:1093
size_t cache_block_size() const
Definition idd.hpp:1087
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
Can execution of the process 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:4829
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 launch 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:4475
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-16-bit, 1-32-bit, 2-64-bit)
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, rebase the program to that 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:6133
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:4103
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.