2006-06-20 Jb Evain <jbevain@gmail.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 (*insert_breakpoint) (guint64 method_argument, const gchar *string_argument);
43         guint64 (*remove_breakpoint) (guint64 breakpoint);
44         MonoInvokeFunc runtime_invoke;
45         guint64 (*create_string) (guint64 dummy_argument, const gchar *string_argument);
46         guint64 (*class_get_static_field_data) (guint64 klass);
47         guint64 (*lookup_class) (guint64 image_argument, guint64 token_arg);
48         guint64 (*lookup_type) (guint64 dummy_argument, const gchar *string_argument);
49         guint64 (*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 };
56
57 struct _MonoDebuggerMetadataInfo {
58         int size;
59         int mono_defaults_size;
60         MonoDefaults *mono_defaults;
61         int type_size;
62         int array_type_size;
63         int klass_size;
64         int thread_size;
65         int thread_tid_offset;
66         int thread_stack_ptr_offset;
67         int thread_end_stack_offset;
68         int klass_instance_size_offset;
69         int klass_parent_offset;
70         int klass_token_offset;
71         int klass_field_offset;
72         int klass_methods_offset;
73         int klass_method_count_offset;
74         int klass_this_arg_offset;
75         int klass_byval_arg_offset;
76         int klass_generic_class_offset;
77         int klass_generic_container_offset;
78         int field_info_size;
79         int mono_defaults_corlib_offset;
80         int mono_defaults_object_offset;
81         int mono_defaults_byte_offset;
82         int mono_defaults_void_offset;
83         int mono_defaults_boolean_offset;
84         int mono_defaults_sbyte_offset;
85         int mono_defaults_int16_offset;
86         int mono_defaults_uint16_offset;
87         int mono_defaults_int32_offset;
88         int mono_defaults_uint32_offset;
89         int mono_defaults_int_offset;
90         int mono_defaults_uint_offset;
91         int mono_defaults_int64_offset;
92         int mono_defaults_uint64_offset;
93         int mono_defaults_single_offset;
94         int mono_defaults_double_offset;
95         int mono_defaults_char_offset;
96         int mono_defaults_string_offset;
97         int mono_defaults_enum_offset;
98         int mono_defaults_array_offset;
99         int mono_defaults_delegate_offset;
100         int mono_defaults_exception_offset;
101 };
102
103 #endif