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 DEBUGGER_RUNTIME_FLAGS_NONE
= 0,
28 DEBUGGER_RUNTIME_FLAGS_ATTACH_OK
= 1
29 } MonoDebuggerRuntimeFlags
;
32 * There's a global data symbol called `MONO_DEBUGGER__debugger_info' which
33 * contains pointers to global variables and functions which must be accessed
36 struct _MonoDebuggerInfo
{
38 guint32 major_version
;
39 guint32 minor_version
;
40 guint32 runtime_flags
;
42 guint32 symbol_table_size
;
43 guint32 mono_trampoline_num
;
44 guint8
**mono_trampoline_code
;
45 gpointer notification_function
;
46 MonoSymbolTable
**symbol_table
;
47 MonoDebuggerMetadataInfo
*metadata_info
;
48 gint32
*debugger_version
;
50 guint64 (*compile_method
) (guint64 method_argument
);
51 guint64 (*get_virtual_method
) (guint64 object_argument
, guint64 method_argument
);
52 guint64 (*get_boxed_object_method
) (guint64 klass_argument
, guint64 val_argument
);
53 MonoInvokeFunc runtime_invoke
;
54 guint64 (*class_get_static_field_data
) (guint64 klass
);
55 guint64 (*run_finally
) (guint64 argument1
, guint64 argument2
);
56 void (*initialize
) (void);
58 guint64 (*create_string
) (G_GNUC_UNUSED guint64 dummy1
, G_GNUC_UNUSED guint64 dummy2
,
59 G_GNUC_UNUSED guint64 dummy3
, const gchar
*string_argument
);
60 gint64 (*lookup_class
) (guint64 image_argument
, G_GNUC_UNUSED guint64 dummy
,
61 G_GNUC_UNUSED guint64 dummy2
, gchar
*full_name
);
63 guint64 (*insert_method_breakpoint
) (guint64 method_argument
, guint64 index
);
64 guint64 (*insert_source_breakpoint
) (guint64 image_argument
, guint64 token
,
65 guint64 index
, const gchar
*class_name
);
66 void (*remove_breakpoint
) (guint64 index
, G_GNUC_UNUSED guint64 dummy
);
68 guint64 (*rgister_class_init_callback
) (guint64 image_argument
, guint64 token
,
69 guint64 index
, const gchar
*class_name
);
70 void (*remove_class_init_callback
) (guint64 index
, G_GNUC_UNUSED guint64 dummy
);
72 MonoDebuggerThreadInfo
**thread_table
;
74 guint8
**executable_code_buffer
;
75 MonoBreakpointInfo
*mono_breakpoint_info
;
76 gssize
*mono_breakpoint_info_index
;
78 guint32 executable_code_buffer_size
;
79 guint32 breakpoint_array_size
;
81 guint64 (*get_method_signature
) (guint64 method_argument
, G_GNUC_UNUSED guint64 dummy
);
82 guint64 (*init_code_buffer
) (void);
85 * These are only needed when attaching.
87 GCThreadFunctions
**thread_vtable_ptr
;
88 GCThreadFunctions
*debugger_thread_vtable
;
89 void (**event_handler_ptr
) (MonoDebuggerEvent event
, guint64 data
, guint64 arg
);
90 void (*debugger_event_handler
) (MonoDebuggerEvent event
, guint64 data
, guint64 arg
);
91 gint32
*using_mono_debugger
;
92 gint32
*interruption_request
;
95 struct _MonoDebuggerMetadataInfo
{
97 int mono_defaults_size
;
98 MonoDefaults
*mono_defaults
;
103 int thread_tid_offset
;
104 int thread_stack_ptr_offset
;
105 int thread_end_stack_offset
;
106 int klass_image_offset
;
107 int klass_instance_size_offset
;
108 int klass_parent_offset
;
109 int klass_token_offset
;
110 int klass_field_offset
;
111 int klass_methods_offset
;
112 int klass_method_count_offset
;
113 int klass_this_arg_offset
;
114 int klass_byval_arg_offset
;
115 int klass_generic_class_offset
;
116 int klass_generic_container_offset
;
117 int klass_vtable_offset
;
119 int field_info_type_offset
;
120 int field_info_offset_offset
;
121 int mono_defaults_corlib_offset
;
122 int mono_defaults_object_offset
;
123 int mono_defaults_byte_offset
;
124 int mono_defaults_void_offset
;
125 int mono_defaults_boolean_offset
;
126 int mono_defaults_sbyte_offset
;
127 int mono_defaults_int16_offset
;
128 int mono_defaults_uint16_offset
;
129 int mono_defaults_int32_offset
;
130 int mono_defaults_uint32_offset
;
131 int mono_defaults_int_offset
;
132 int mono_defaults_uint_offset
;
133 int mono_defaults_int64_offset
;
134 int mono_defaults_uint64_offset
;
135 int mono_defaults_single_offset
;
136 int mono_defaults_double_offset
;
137 int mono_defaults_char_offset
;
138 int mono_defaults_string_offset
;
139 int mono_defaults_enum_offset
;
140 int mono_defaults_array_offset
;
141 int mono_defaults_delegate_offset
;
142 int mono_defaults_exception_offset
;
143 int mono_method_klass_offset
;
144 int mono_method_token_offset
;
145 int mono_method_flags_offset
;
146 int mono_method_inflated_offset
;
147 int mono_vtable_klass_offset
;
148 int mono_vtable_vtable_offset
;