2 * This is a private header file for the debugger.
5 #ifndef __DEBUG_DEBUGGER_H__
6 #define __DEBUG_DEBUGGER_H__
8 #if !defined _IN_THE_MONO_DEBUGGER
9 #error "<debug-debugger.h> is a private header file only intended to be used by the debugger."
12 #include <mono/metadata/class-internals.h>
13 #include <mono/metadata/mono-debug-debugger.h>
14 #include <libgc/include/libgc-mono-debugger.h>
15 #include "debug-mini.h"
17 typedef struct _MonoDebuggerInfo MonoDebuggerInfo
;
18 typedef struct _MonoDebuggerMetadataInfo MonoDebuggerMetadataInfo
;
21 * Address of the x86 trampoline code. This is used by the debugger to check
22 * whether a method is a trampoline.
24 extern guint8
*mono_trampoline_code
[];
27 * There's a global data symbol called `MONO_DEBUGGER__debugger_info' which
28 * contains pointers to global variables and functions which must be accessed
31 struct _MonoDebuggerInfo
{
33 guint32 major_version
;
34 guint32 minor_version
;
37 guint32 symbol_table_size
;
38 guint32 mono_trampoline_num
;
39 guint8
**mono_trampoline_code
;
40 gpointer notification_function
;
41 MonoSymbolTable
**symbol_table
;
42 MonoDebuggerMetadataInfo
*metadata_info
;
43 gint32
*debugger_version
;
45 guint64 (*compile_method
) (guint64 method_argument
);
46 guint64 (*get_virtual_method
) (guint64 object_argument
, guint64 method_argument
);
47 guint64 (*get_boxed_object_method
) (guint64 klass_argument
, guint64 val_argument
);
48 MonoInvokeFunc runtime_invoke
;
49 guint64 (*class_get_static_field_data
) (guint64 klass
);
50 guint64 (*run_finally
) (guint64 argument1
, guint64 argument2
);
51 void (*initialize
) (void);
53 guint64 (*create_string
) (G_GNUC_UNUSED guint64 dummy1
, G_GNUC_UNUSED guint64 dummy2
,
54 G_GNUC_UNUSED guint64 dummy3
, const gchar
*string_argument
);
55 gint64 (*lookup_class
) (guint64 image_argument
, G_GNUC_UNUSED guint64 dummy
,
56 G_GNUC_UNUSED guint64 dummy2
, gchar
*full_name
);
58 guint64 (*insert_method_breakpoint
) (guint64 method_argument
, guint64 index
);
59 guint64 (*insert_source_breakpoint
) (guint64 image_argument
, guint64 token
,
60 guint64 index
, const gchar
*class_name
);
61 void (*remove_breakpoint
) (guint64 index
, G_GNUC_UNUSED guint64 dummy
);
63 guint64 (*rgister_class_init_callback
) (guint64 image_argument
, guint64 token
,
64 guint64 index
, const gchar
*class_name
);
65 void (*remove_class_init_callback
) (guint64 index
, G_GNUC_UNUSED guint64 dummy
);
67 MonoDebuggerThreadInfo
**thread_table
;
69 guint8
**executable_code_buffer
;
70 MonoBreakpointInfo
*mono_breakpoint_info
;
71 gssize
*mono_breakpoint_info_index
;
73 guint32 executable_code_buffer_size
;
74 guint32 breakpoint_array_size
;
76 guint64 (*get_method_signature
) (guint64 method_argument
, G_GNUC_UNUSED guint64 dummy
);
77 guint64 (*init_code_buffer
) (void);
80 * These are only needed when attaching.
82 GCThreadFunctions
**thread_vtable_ptr
;
83 GCThreadFunctions
*debugger_thread_vtable
;
84 void (**event_handler_ptr
) (MonoDebuggerEvent event
, guint64 data
, guint64 arg
);
85 void (*debugger_event_handler
) (MonoDebuggerEvent event
, guint64 data
, guint64 arg
);
86 gint32
*using_mono_debugger
;
87 gint32
*interruption_request
;
90 struct _MonoDebuggerMetadataInfo
{
92 int mono_defaults_size
;
93 MonoDefaults
*mono_defaults
;
98 int thread_tid_offset
;
99 int thread_stack_ptr_offset
;
100 int thread_end_stack_offset
;
101 int klass_image_offset
;
102 int klass_instance_size_offset
;
103 int klass_parent_offset
;
104 int klass_token_offset
;
105 int klass_field_offset
;
106 int klass_methods_offset
;
107 int klass_method_count_offset
;
108 int klass_this_arg_offset
;
109 int klass_byval_arg_offset
;
110 int klass_generic_class_offset
;
111 int klass_generic_container_offset
;
112 int klass_vtable_offset
;
114 int field_info_type_offset
;
115 int field_info_offset_offset
;
116 int mono_defaults_corlib_offset
;
117 int mono_defaults_object_offset
;
118 int mono_defaults_byte_offset
;
119 int mono_defaults_void_offset
;
120 int mono_defaults_boolean_offset
;
121 int mono_defaults_sbyte_offset
;
122 int mono_defaults_int16_offset
;
123 int mono_defaults_uint16_offset
;
124 int mono_defaults_int32_offset
;
125 int mono_defaults_uint32_offset
;
126 int mono_defaults_int_offset
;
127 int mono_defaults_uint_offset
;
128 int mono_defaults_int64_offset
;
129 int mono_defaults_uint64_offset
;
130 int mono_defaults_single_offset
;
131 int mono_defaults_double_offset
;
132 int mono_defaults_char_offset
;
133 int mono_defaults_string_offset
;
134 int mono_defaults_enum_offset
;
135 int mono_defaults_array_offset
;
136 int mono_defaults_delegate_offset
;
137 int mono_defaults_exception_offset
;
138 int mono_method_klass_offset
;
139 int mono_method_token_offset
;
140 int mono_method_flags_offset
;
141 int mono_method_inflated_offset
;
142 int mono_vtable_klass_offset
;
143 int mono_vtable_vtable_offset
;