* Makefile.am (version.h): Fix issues when built out of tree.
[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 enum {
17         MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE     = 1,
18         MONO_DEBUGGER_EVENT_INITIALIZE_CORLIB,
19         MONO_DEBUGGER_EVENT_JIT_BREAKPOINT,
20         MONO_DEBUGGER_EVENT_INITIALIZE_THREAD_MANAGER,
21         MONO_DEBUGGER_EVENT_ACQUIRE_GLOBAL_THREAD_LOCK,
22         MONO_DEBUGGER_EVENT_RELEASE_GLOBAL_THREAD_LOCK,
23         MONO_DEBUGGER_EVENT_WRAPPER_MAIN,
24         MONO_DEBUGGER_EVENT_MAIN_EXITED,
25         MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
26         MONO_DEBUGGER_EVENT_THROW_EXCEPTION,
27         MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION,
28         MONO_DEBUGGER_EVENT_THREAD_CREATED,
29         MONO_DEBUGGER_EVENT_THREAD_CLEANUP,
30         MONO_DEBUGGER_EVENT_GC_THREAD_CREATED,
31         MONO_DEBUGGER_EVENT_GC_THREAD_EXITED,
32         MONO_DEBUGGER_EVENT_REACHED_MAIN,
33         MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE,
34         MONO_DEBUGGER_EVENT_LOAD_MODULE,
35         MONO_DEBUGGER_EVENT_UNLOAD_MODULE,
36         MONO_DEBUGGER_EVENT_DOMAIN_CREATE,
37         MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD,
38         MONO_DEBUGGER_EVENT_CLASS_INITIALIZED,
39         MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST,
40         MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN,
41         MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN,
42
43         /* Extended per-thread notifications */
44         MONO_DEBUGGER_EVENT_TRAMPOLINE                  = 256,
45 } MonoDebuggerEvent;
46
47 extern volatile gint32 _mono_debugger_interruption_request;
48
49 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
50
51 void            mono_debugger_initialize                    (gboolean use_debugger);
52 void            mono_debugger_cleanup                       (void);
53
54 void            mono_debugger_lock                          (void);
55 void            mono_debugger_unlock                        (void);
56 void            mono_debugger_event                         (MonoDebuggerEvent event, guint64 data, guint64 arg);
57
58 void *
59 mono_vtable_get_static_field_data (MonoVTable *vt);
60
61 gchar *
62 mono_debugger_check_runtime_version (const char *filename);
63
64 void
65 mono_debugger_class_initialized (MonoClass *klass);
66
67 void
68 mono_debugger_check_interruption (void);
69
70 void
71 mono_debugger_event_create_appdomain (MonoDomain *domain, gchar *shadow_path);
72
73 void
74 mono_debugger_event_unload_appdomain (MonoDomain *domain);
75
76 MonoDebugMethodAddressList *
77 mono_debugger_insert_method_breakpoint (MonoMethod *method, guint64 idx);
78
79 int
80 mono_debugger_remove_method_breakpoint (guint64 index);
81
82 void
83 mono_debugger_check_breakpoints (MonoMethod *method, MonoDebugMethodAddress *debug_info);
84
85 MonoClass *
86 mono_debugger_register_class_init_callback (MonoImage *image, const gchar *full_name,
87                                             guint32 token, guint32 index);
88
89 void
90 mono_debugger_remove_class_init_callback (int index);
91
92 #endif /* __MONO_DEBUG_DEBUGGER_H__ */