* debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove double g_free.
[mono.git] / mono / metadata / mono-debug-debugger.h
1 /*
2  * This is a private header file.
3  * The API in here is undocumented and may only be used by the JIT to
4  * communicate with the debugger.
5  */
6
7 #ifndef __MONO_DEBUG_DEBUGGER_H__
8 #define __MONO_DEBUG_DEBUGGER_H__
9
10 #include <glib.h>
11 #include <mono/metadata/debug-helpers.h>
12 #include <mono/metadata/debug-mono-symfile.h>
13 #include <mono/utils/mono-codeman.h>
14 #include <mono/io-layer/io-layer.h>
15
16 typedef struct _MonoDebuggerBreakpointInfo      MonoDebuggerBreakpointInfo;
17
18 typedef enum {
19         MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE     = 1,
20         MONO_DEBUGGER_EVENT_ADD_MODULE,
21         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS,
22         MONO_DEBUGGER_EVENT_METHOD_COMPILED,
23         MONO_DEBUGGER_EVENT_JIT_BREAKPOINT,
24         MONO_DEBUGGER_EVENT_INITIALIZE_THREAD_MANAGER,
25         MONO_DEBUGGER_EVENT_ACQUIRE_GLOBAL_THREAD_LOCK,
26         MONO_DEBUGGER_EVENT_RELEASE_GLOBAL_THREAD_LOCK,
27         MONO_DEBUGGER_EVENT_WRAPPER_MAIN,
28         MONO_DEBUGGER_EVENT_MAIN_EXITED,
29         MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
30         MONO_DEBUGGER_EVENT_THREAD_CREATED,
31         MONO_DEBUGGER_EVENT_THREAD_ABORT,
32         MONO_DEBUGGER_EVENT_THREAD_EXITED,
33         MONO_DEBUGGER_EVENT_THROW_EXCEPTION,
34         MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION,
35         MONO_DEBUGGER_EVENT_REACHED_MAIN,
36         MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE
37 } MonoDebuggerEvent;
38
39 struct _MonoDebuggerBreakpointInfo {
40         guint32 index;
41         MonoMethodDesc *desc;
42 };
43
44 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
45
46 void            mono_debugger_initialize                  (gboolean use_debugger);
47 void            mono_debugger_cleanup                     (void);
48
49 void            mono_debugger_lock                        (void);
50 void            mono_debugger_unlock                      (void);
51 void            mono_debugger_event                       (MonoDebuggerEvent event, guint64 data, guint64 arg);
52
53 void            mono_debugger_add_symbol_file             (MonoDebugHandle *handle);
54 void            mono_debugger_start_add_type              (MonoDebugHandle *symfile, MonoClass *klass);
55
56 int             mono_debugger_insert_breakpoint_full      (MonoMethodDesc *desc);
57 int             mono_debugger_remove_breakpoint           (int breakpoint_id);
58 void            mono_debugger_breakpoint_callback         (MonoMethod *method, guint32 idx);
59
60 guint8         *mono_debugger_create_notification_function(MonoCodeManager *codeman);
61
62 MonoObject     *mono_debugger_runtime_invoke              (MonoMethod *method, void *obj,
63                                                            void **params, MonoObject **exc);
64
65 gboolean        mono_debugger_lookup_type                 (const gchar *type_name);
66 gint32          mono_debugger_lookup_assembly             (const gchar *name);
67
68 void *
69 mono_vtable_get_static_field_data (MonoVTable *vt);
70
71 gchar *
72 mono_debugger_check_runtime_version (const char *filename);
73
74 #endif /* __MONO_DEBUG_DEBUGGER_H__ */