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_generic_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 guint32 (*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_type (MonoDebugHandle *symfile, MonoClass *klass);
84 void mono_debugger_add_builtin_types (MonoDebugHandle *symfile);
86 void mono_debugger_add_method (MonoDebugMethodJitInfo *jit);
88 void mono_debugger_add_wrapper (MonoMethod *wrapper,
89 MonoDebugMethodJitInfo *jit,
93 int mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc);
94 int mono_debugger_remove_breakpoint (int breakpoint_id);
95 int mono_debugger_insert_breakpoint (const gchar *method_name, gboolean include_namespace);
96 int mono_debugger_method_has_breakpoint (MonoMethod *method);
97 void mono_debugger_breakpoint_callback (MonoMethod *method, guint32 idx);
99 gpointer mono_debugger_create_notification_function (gpointer *notification_address);
101 MonoObject *mono_debugger_runtime_invoke (MonoMethod *method, void *obj,
102 void **params, MonoObject **exc);
104 gboolean mono_debugger_lookup_type (const gchar *type_name);
105 gint32 mono_debugger_lookup_assembly (const gchar *name);
106 gboolean mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc);
107 void mono_debugger_handle_exception (gpointer addr, gpointer stack, MonoObject *exc);
108 gboolean mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc);
113 mono_vtable_get_static_field_data (MonoVTable *vt);
116 MonoReflectionMethod *
117 ves_icall_MonoDebugger_GetMethod (MonoReflectionAssembly *assembly, guint32 token);
120 ves_icall_MonoDebugger_GetMethodToken (MonoReflectionAssembly *assembly, MonoReflectionMethod *method);
123 ves_icall_MonoDebugger_GetLocalTypeFromSignature (MonoReflectionAssembly *assembly, MonoArray *signature);
126 ves_icall_MonoDebugger_GetType (MonoReflectionAssembly *assembly, guint32 token);
129 mono_debugger_check_runtime_version (const char *filename);
131 #endif /* __MONO_DEBUG_DEBUGGER_H__ */