2 * This header is only installed for use by the debugger:
3 * the structures and the API declared here are not supported.
6 #ifndef __MONO_DEBUG_DEBUGGER_H__
7 #define __MONO_DEBUG_DEBUGGER_H__
10 #include <mono/metadata/debug-helpers.h>
11 #include <mono/metadata/debug-mono-symfile.h>
12 #include <mono/io-layer/io-layer.h>
14 typedef struct _MonoDebuggerBreakpointInfo MonoDebuggerBreakpointInfo;
15 typedef struct _MonoDebuggerIOLayer MonoDebuggerIOLayer;
18 MONO_DEBUGGER_EVENT_BREAKPOINT,
19 MONO_DEBUGGER_EVENT_ADD_MODULE,
20 MONO_DEBUGGER_EVENT_RELOAD_SYMTABS,
21 MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
22 MONO_DEBUGGER_EVENT_EXCEPTION,
23 MONO_DEBUGGER_EVENT_THROW_EXCEPTION
26 struct _MonoDebuggerBreakpointInfo {
32 * Address of the x86 trampoline code. This is used by the debugger to check
33 * whether a method is a trampoline.
35 extern guint8 *mono_trampoline_code [];
37 #ifndef PLATFORM_WIN32
40 * Functions we export to the debugger.
42 struct _MonoDebuggerIOLayer
44 void (*InitializeCriticalSection) (WapiCriticalSection *section);
45 void (*DeleteCriticalSection) (WapiCriticalSection *section);
46 gboolean (*TryEnterCriticalSection) (WapiCriticalSection *section);
47 void (*EnterCriticalSection) (WapiCriticalSection *section);
48 void (*LeaveCriticalSection) (WapiCriticalSection *section);
50 guint32 (*WaitForSingleObject) (gpointer handle, guint32 timeout,
52 guint32 (*SignalObjectAndWait) (gpointer signal_handle, gpointer wait,
53 guint32 timeout, gboolean alertable);
54 guint32 (*WaitForMultipleObjects) (guint32 numobjects, gpointer *handles,
55 gboolean waitall, guint32 timeout, gboolean alertable);
57 gpointer (*CreateSemaphore) (WapiSecurityAttributes *security,
58 gint32 initial, gint32 max,
59 const gunichar2 *name);
60 gboolean (*ReleaseSemaphore) (gpointer handle, gint32 count, gint32 *prevcount);
62 gpointer (*CreateThread) (WapiSecurityAttributes *security,
63 guint32 stacksize, WapiThreadStart start,
64 gpointer param, guint32 create, guint32 *tid);
65 gsize (*GetCurrentThreadId) (void);
68 extern MonoDebuggerIOLayer mono_debugger_io_layer;
72 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
74 void mono_debugger_initialize (gboolean use_debugger);
75 void mono_debugger_cleanup (void);
77 void mono_debugger_lock (void);
78 void mono_debugger_unlock (void);
79 void mono_debugger_event (MonoDebuggerEvent event, guint64 data, guint64 arg);
81 void mono_debugger_add_symbol_file (MonoDebugHandle *handle);
82 void mono_debugger_start_add_type (MonoDebugHandle *symfile, MonoClass *klass);
83 void mono_debugger_add_builtin_types (MonoDebugHandle *symfile);
85 int mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc);
86 int mono_debugger_remove_breakpoint (int breakpoint_id);
87 int mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace);
88 int mono_debugger_method_has_breakpoint (MonoMethod *method);
89 void mono_debugger_breakpoint_callback (MonoMethod *method, guint32 idx);
91 gpointer mono_debugger_create_notification_function (gpointer *notification_address);
93 MonoObject *mono_debugger_runtime_invoke (MonoMethod *method, void *obj,
94 void **params, MonoObject **exc);
96 gboolean mono_debugger_lookup_type (const gchar *type_name);
97 gint32 mono_debugger_lookup_assembly (const gchar *name);
98 gboolean mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc);
99 void mono_debugger_handle_exception (gpointer addr, gpointer stack, MonoObject *exc);
100 gboolean mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc);
105 mono_vtable_get_static_field_data (MonoVTable *vt);
108 mono_debugger_check_runtime_version (const char *filename);
110 #endif /* __MONO_DEBUG_DEBUGGER_H__ */