1 #ifndef __MONO_DEBUG_DEBUGGER_H__
2 #define __MONO_DEBUG_DEBUGGER_H__
5 #include <mono/metadata/debug-helpers.h>
6 #include <mono/metadata/debug-mono-symfile.h>
8 typedef struct _MonoDebuggerBreakpointInfo MonoDebuggerBreakpointInfo;
9 typedef struct _MonoDebuggerSymbolTable MonoDebuggerSymbolTable;
10 typedef struct _MonoDebuggerSymbolFile MonoDebuggerSymbolFile;
11 typedef struct _MonoDebuggerSymbolFilePriv MonoDebuggerSymbolFilePriv;
12 typedef struct _MonoDebuggerRangeInfo MonoDebuggerRangeInfo;
13 typedef struct _MonoDebuggerClassInfo MonoDebuggerClassInfo;
16 MONO_DEBUGGER_EVENT_TYPE_ADDED,
17 MONO_DEBUGGER_EVENT_METHOD_ADDED,
18 MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE
21 struct _MonoDebuggerBreakpointInfo {
23 gboolean use_trampoline;
27 struct _MonoDebuggerSymbolTable {
34 * This is intentionally not a GPtrArray to make it more easy to
35 * read for the debugger. The `type_tables' field contains
36 * `num_type_tables' pointers to continuous memory areas of
37 * `type_table_chunk_size' bytes each.
39 * The type table is basically a big continuous blob, but we need
40 * to split it up into pieces because we don't know the total size
41 * in advance and using g_realloc() doesn't work because that may
42 * reallocate the block to a different address.
44 guint32 num_type_tables;
45 guint32 type_table_chunk_size;
46 gpointer *type_tables;
49 * The `current_type_table' points to a blob of `type_table_chunk_size'
52 gpointer current_type_table;
54 * This is the total size of the type table, including all the tables
55 * in the `type_tables' vector.
57 guint32 type_table_size;
59 * These are global offsets - the `current_type_table' starts at global
60 * offset `type_table_start' and we've already allocated stuff in it
61 * until offset `type_table_offset'.
63 guint32 type_table_offset;
64 guint32 type_table_start;
69 guint32 num_symbol_files;
70 MonoDebuggerSymbolFile **symbol_files;
73 struct _MonoDebuggerSymbolFile {
74 MonoSymbolFile *symfile;
75 const char *image_file;
76 /* Pointer to the malloced range table. */
79 MonoDebuggerRangeInfo *range_table;
80 guint32 range_entry_size;
81 guint32 num_range_entries;
82 /* Pointer to the malloced class table. */
83 MonoDebuggerClassInfo *class_table;
84 guint32 class_entry_size;
85 guint32 num_class_entries;
87 MonoDebuggerSymbolFilePriv *_priv;
90 struct _MonoDebuggerRangeInfo {
91 const guint8 *start_address;
92 const guint8 *end_address;
94 gpointer dynamic_data;
98 struct _MonoDebuggerClassInfo {
105 extern MonoDebuggerSymbolTable *mono_debugger_symbol_table;
107 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, gpointer data, gpointer data2);
109 void mono_debugger_initialize (void);
110 void mono_debugger_cleanup (void);
112 void mono_debugger_lock (void);
113 void mono_debugger_unlock (void);
114 void mono_debugger_event (MonoDebuggerEvent event, gpointer data, gpointer data2);
116 MonoDebuggerSymbolFile *mono_debugger_add_symbol_file (MonoSymbolFile *symfile);
117 void mono_debugger_add_type (MonoDebuggerSymbolFile *symfile, MonoClass *klass);
118 void mono_debugger_add_method (MonoDebuggerSymbolFile *symfile, MonoMethod *method);
120 int mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc, gboolean use_trampoline);
121 int mono_debugger_remove_breakpoint (int breakpoint_id);
122 int mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace);
123 int mono_debugger_method_has_breakpoint (MonoMethod* method, gboolean use_trampoline);
124 void mono_debugger_trampoline_breakpoint_callback (void);
126 gpointer mono_debugger_create_notification_function (gpointer *notification_address);
128 MonoReflectionMethod *
129 ves_icall_MonoDebugger_GetMethod (MonoReflectionAssembly *assembly, guint32 token);
132 ves_icall_MonoDebugger_GetMethodToken (MonoReflectionAssembly *assembly, MonoReflectionMethod *method);
135 ves_icall_MonoDebugger_GetLocalTypeFromSignature (MonoReflectionAssembly *assembly, MonoArray *signature);
138 ves_icall_MonoDebugger_GetType (MonoReflectionAssembly *assembly, guint32 token);
140 #endif /* __MONO_DEBUG_DEBUGGER_H__ */