2007-06-28 Martin Baulig <martin@ximian.com>
[mono.git] / mono / mini / debug-debugger.h
1 /*
2  * This is a private header file for the debugger.
3  */
4
5 #ifndef __DEBUG_DEBUGGER_H__
6 #define __DEBUG_DEBUGGER_H__
7
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."
10 #endif
11
12 #include <mono/metadata/class-internals.h>
13 #include <mono/metadata/mono-debug-debugger.h>
14
15 typedef struct _MonoDebuggerInfo                MonoDebuggerInfo;
16 typedef struct _MonoDebuggerMetadataInfo        MonoDebuggerMetadataInfo;
17
18 /*
19  * Address of the x86 trampoline code.  This is used by the debugger to check
20  * whether a method is a trampoline.
21  */
22 extern guint8 *mono_trampoline_code [];
23
24 /*
25  * There's a global data symbol called `MONO_DEBUGGER__debugger_info' which
26  * contains pointers to global variables and functions which must be accessed
27  * by the debugger.
28  */
29 struct _MonoDebuggerInfo {
30         guint64 magic;
31         guint32 version;
32         guint32 total_size;
33         guint32 symbol_table_size;
34         guint32 dummy;
35         gpointer notification_function;
36         guint8 **mono_trampoline_code;
37         MonoSymbolTable **symbol_table;
38         MonoDebuggerMetadataInfo *metadata_info;
39         guint64 (*compile_method) (guint64 method_argument);
40         guint64 (*get_virtual_method) (guint64 object_argument, guint64 method_argument);
41         guint64 (*get_boxed_object_method) (guint64 klass_argument, guint64 val_argument);
42         guint64 (*old_insert_breakpoint) (guint64 method_arg, const gchar *string_arg);
43         guint64 (*old_remove_breakpoint) (guint64 breakpoint);
44         MonoInvokeFunc runtime_invoke;
45         guint64 (*old_create_string) (G_GNUC_UNUSED guint64 dummy, const gchar *string_arg);
46         guint64 (*class_get_static_field_data) (guint64 klass);
47         guint64 (*old_lookup_class) (guint64 image_argument, guint64 token_arg);
48         void (*obsolete_dummy1) (void);  /* `lookup_type' was already unused in 0.50 "Dublin". */
49         guint64 (*old_lookup_assembly) (guint64 dummy_argument, const gchar *string_argument);
50         guint64 (*run_finally) (guint64 argument1, guint64 argument2);
51         guint64 (*get_current_thread) (void);
52         void (*attach) (void);
53         void (*detach) (void);
54         void (*initialize) (void);
55         void * (*get_lmf_addr) (void);
56
57         guint32 *debugger_version;
58
59         guint64 (*create_string) (G_GNUC_UNUSED guint64 dummy1, G_GNUC_UNUSED guint64 dummy2,
60                                   const gchar *string_argument);
61         gint64 (*lookup_class) (guint64 image_argument, G_GNUC_UNUSED guint64 dummy,
62                                 gchar *full_name);
63         guint64 (*lookup_assembly) (G_GNUC_UNUSED guint64 dummy, G_GNUC_UNUSED guint64 dummy2,
64                                     const gchar *string_argument);
65         gint64 (*get_method_addr_or_bpt) (guint64 method_argument, guint64 index);
66         void (*remove_method_breakpoint) (G_GNUC_UNUSED guint64 dummy, guint64 index);
67         void (*runtime_class_init) (guint64 klass_arg);
68 };
69
70 struct _MonoDebuggerMetadataInfo {
71         int size;
72         int mono_defaults_size;
73         MonoDefaults *mono_defaults;
74         int type_size;
75         int array_type_size;
76         int klass_size;
77         int thread_size;
78         int thread_tid_offset;
79         int thread_stack_ptr_offset;
80         int thread_end_stack_offset;
81         int klass_instance_size_offset;
82         int klass_parent_offset;
83         int klass_token_offset;
84         int klass_field_offset;
85         int klass_methods_offset;
86         int klass_method_count_offset;
87         int klass_this_arg_offset;
88         int klass_byval_arg_offset;
89         int klass_generic_class_offset;
90         int klass_generic_container_offset;
91         int field_info_size;
92         int mono_defaults_corlib_offset;
93         int mono_defaults_object_offset;
94         int mono_defaults_byte_offset;
95         int mono_defaults_void_offset;
96         int mono_defaults_boolean_offset;
97         int mono_defaults_sbyte_offset;
98         int mono_defaults_int16_offset;
99         int mono_defaults_uint16_offset;
100         int mono_defaults_int32_offset;
101         int mono_defaults_uint32_offset;
102         int mono_defaults_int_offset;
103         int mono_defaults_uint_offset;
104         int mono_defaults_int64_offset;
105         int mono_defaults_uint64_offset;
106         int mono_defaults_single_offset;
107         int mono_defaults_double_offset;
108         int mono_defaults_char_offset;
109         int mono_defaults_string_offset;
110         int mono_defaults_enum_offset;
111         int mono_defaults_array_offset;
112         int mono_defaults_delegate_offset;
113         int mono_defaults_exception_offset;
114 };
115
116 #endif