Fix variant iface verification.
[mono.git] / mono / metadata / mono-debug-debugger.h
index 25c5879b657049c4a74afea7f6e8167c9089db7d..ed6efa072945478e099bcf7ad2a70db1f80a9f8d 100644 (file)
@@ -1,31 +1,21 @@
 /*
- * This header is only installed for use by the debugger:
- * the structures and the API declared here are not supported.
+ * This is a private header file.
+ * The API in here is undocumented and may only be used by the JIT to
+ * communicate with the debugger.
  */
 
 #ifndef __MONO_DEBUG_DEBUGGER_H__
 #define __MONO_DEBUG_DEBUGGER_H__
 
-#if !defined _IN_THE_MONO_DEBUGGER
-#error "<mono/metadata/mono-debug-debugger.h> is a private header file only intended to be used by the debugger."
-#endif
-
 #include <glib.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/debug-mono-symfile.h>
+#include <mono/utils/mono-codeman.h>
 #include <mono/io-layer/io-layer.h>
 
-typedef struct _MonoDebuggerBreakpointInfo     MonoDebuggerBreakpointInfo;
-typedef struct _MonoDebuggerIOLayer            MonoDebuggerIOLayer;
-typedef struct _MonoDebuggerInfo               MonoDebuggerInfo;
-typedef struct _MonoDebuggerThread             MonoDebuggerThread;
-typedef struct _MonoDebuggerManager             MonoDebuggerManager;
-
 typedef enum {
        MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE     = 1,
-       MONO_DEBUGGER_EVENT_ADD_MODULE,
-       MONO_DEBUGGER_EVENT_RELOAD_SYMTABS,
-       MONO_DEBUGGER_EVENT_METHOD_COMPILED,
+       MONO_DEBUGGER_EVENT_INITIALIZE_CORLIB,
        MONO_DEBUGGER_EVENT_JIT_BREAKPOINT,
        MONO_DEBUGGER_EVENT_INITIALIZE_THREAD_MANAGER,
        MONO_DEBUGGER_EVENT_ACQUIRE_GLOBAL_THREAD_LOCK,
@@ -33,138 +23,72 @@ typedef enum {
        MONO_DEBUGGER_EVENT_WRAPPER_MAIN,
        MONO_DEBUGGER_EVENT_MAIN_EXITED,
        MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
-       MONO_DEBUGGER_EVENT_THREAD_CREATED,
-       MONO_DEBUGGER_EVENT_THREAD_ABORT,
        MONO_DEBUGGER_EVENT_THROW_EXCEPTION,
-       MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION
+       MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION,
+       MONO_DEBUGGER_EVENT_THREAD_CREATED,
+       MONO_DEBUGGER_EVENT_THREAD_CLEANUP,
+       MONO_DEBUGGER_EVENT_GC_THREAD_CREATED,
+       MONO_DEBUGGER_EVENT_GC_THREAD_EXITED,
+       MONO_DEBUGGER_EVENT_REACHED_MAIN,
+       MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE,
+       MONO_DEBUGGER_EVENT_LOAD_MODULE,
+       MONO_DEBUGGER_EVENT_UNLOAD_MODULE,
+       MONO_DEBUGGER_EVENT_DOMAIN_CREATE,
+       MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD,
+       MONO_DEBUGGER_EVENT_CLASS_INITIALIZED,
+       MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST,
+       MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN,
+       MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN,
+
+       /* Obsolete, only for backwards compatibility with older debugger versions */
+       MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE              = 256,
+
+       MONO_DEBUGGER_EVENT_TRAMPOLINE                  = 512
 } MonoDebuggerEvent;
 
-struct _MonoDebuggerBreakpointInfo {
-       guint32 index;
-       MonoMethodDesc *desc;
-};
+extern volatile gint32 _mono_debugger_interruption_request;
 
-/*
- * Address of the x86 trampoline code.  This is used by the debugger to check
- * whether a method is a trampoline.
- */
-extern guint8 *mono_trampoline_code [];
-
-#ifndef PLATFORM_WIN32
-
-/*
- * Functions we export to the debugger.
- */
-struct _MonoDebuggerIOLayer
-{
-       void (*InitializeCriticalSection) (WapiCriticalSection *section);
-       void (*DeleteCriticalSection) (WapiCriticalSection *section);
-       gboolean (*TryEnterCriticalSection) (WapiCriticalSection *section);
-       void (*EnterCriticalSection) (WapiCriticalSection *section);
-       void (*LeaveCriticalSection) (WapiCriticalSection *section);
-
-       guint32 (*WaitForSingleObject) (gpointer handle, guint32 timeout, 
-                                       gboolean alertable);
-       guint32 (*SignalObjectAndWait) (gpointer signal_handle, gpointer wait,
-                                       guint32 timeout, gboolean alertable);
-       guint32 (*WaitForMultipleObjects) (guint32 numobjects, gpointer *handles,
-                                     gboolean waitall, guint32 timeout, gboolean alertable);
-
-       gpointer (*CreateSemaphore) (WapiSecurityAttributes *security,
-                                    gint32 initial, gint32 max,
-                                    const gunichar2 *name);
-       gboolean (*ReleaseSemaphore) (gpointer handle, gint32 count, gint32 *prevcount);
-
-       gpointer (*CreateThread) (WapiSecurityAttributes *security,
-                                 guint32 stacksize, WapiThreadStart start,
-                                 gpointer param, guint32 create, guint32 *tid);
-       gsize (*GetCurrentThreadId) (void);
-};
+extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
-/*
- * There's a global data symbol called `MONO_DEBUGGER__debugger_info' which
- * contains pointers to global variables and functions which must be accessed
- * by the debugger.
- */
-struct _MonoDebuggerInfo {
-       guint64 magic;
-       guint32 version;
-       guint32 total_size;
-       guint32 symbol_table_size;
-       guint32 dummy;
-       guint8 ***mono_trampoline_code;
-       MonoSymbolTable **symbol_table;
-       guint64 (*compile_method) (guint64 method_argument);
-       guint64 (*get_virtual_method) (guint64 object_argument, guint64 method_argument);
-       guint64 (*get_boxed_object_method) (guint64 klass_argument, guint64 val_argument);
-       guint64 (*insert_breakpoint) (guint64 method_argument, const gchar *string_argument);
-       guint64 (*remove_breakpoint) (guint64 breakpoint);
-       MonoInvokeFunc runtime_invoke;
-       guint64 (*create_string) (guint64 dummy_argument, const gchar *string_argument);
-       guint64 (*class_get_static_field_data) (guint64 klass);
-       guint64 (*lookup_class) (guint64 image_argument, guint64 token_arg);
-       guint64 (*lookup_type) (guint64 dummy_argument, const gchar *string_argument);
-       guint64 (*lookup_assembly) (guint64 dummy_argument, const gchar *string_argument);
-       guint64 (*run_finally) (guint64 argument1, guint64 argument2);
-};
-
-struct _MonoDebuggerThread {
-       gpointer end_stack;
-       guint32 tid;
-       guint32 locked;
-       gpointer func;
-       gpointer start_stack;
-};
-
-struct _MonoDebuggerManager {
-       guint32 size;
-       guint32 thread_size;
-       gpointer main_function;
-       gpointer notification_address;
-       MonoDebuggerThread *main_thread;
-       guint32 main_tid;
-};
-
-extern MonoDebuggerIOLayer mono_debugger_io_layer;
-
-#endif
+void            mono_debugger_initialize                    (gboolean use_debugger);
+void            mono_debugger_cleanup                       (void);
 
-extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
+void            mono_debugger_lock                          (void);
+void            mono_debugger_unlock                        (void);
+void            mono_debugger_event                         (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
-void            mono_debugger_initialize                  (gboolean use_debugger);
-void            mono_debugger_cleanup                     (void);
+void *
+mono_vtable_get_static_field_data (MonoVTable *vt);
 
-void            mono_debugger_lock                        (void);
-void            mono_debugger_unlock                      (void);
-void            mono_debugger_event                       (MonoDebuggerEvent event, guint64 data, guint64 arg);
+gchar *
+mono_debugger_check_runtime_version (const char *filename);
 
-void            mono_debugger_add_symbol_file             (MonoDebugHandle *handle);
-void            mono_debugger_start_add_type              (MonoDebugHandle *symfile, MonoClass *klass);
-void            mono_debugger_add_builtin_types           (MonoDebugHandle *symfile);
+void
+mono_debugger_class_initialized (MonoClass *klass);
 
-int             mono_debugger_insert_breakpoint_full      (MonoMethodDesc *desc);
-int             mono_debugger_remove_breakpoint           (int breakpoint_id);
-int             mono_debugger_insert_breakpoint           (const gchar *method_name, gboolean include_namespace);
-int             mono_debugger_method_has_breakpoint       (MonoMethod *method);
-void            mono_debugger_breakpoint_callback         (MonoMethod *method, guint32 idx);
+void
+mono_debugger_check_interruption (void);
 
-gpointer        mono_debugger_create_notification_function (gpointer *notification_address);
+void
+mono_debugger_event_create_appdomain (MonoDomain *domain, gchar *shadow_path);
 
-MonoObject     *mono_debugger_runtime_invoke              (MonoMethod *method, void *obj,
-                                                          void **params, MonoObject **exc);
+void
+mono_debugger_event_unload_appdomain (MonoDomain *domain);
 
-gboolean        mono_debugger_lookup_type                 (const gchar *type_name);
-gint32          mono_debugger_lookup_assembly             (const gchar *name);
-gboolean        mono_debugger_unhandled_exception         (gpointer addr, gpointer stack, MonoObject *exc);
-void            mono_debugger_handle_exception            (gpointer addr, gpointer stack, MonoObject *exc);
-gboolean        mono_debugger_throw_exception             (gpointer addr, gpointer stack, MonoObject *exc);
+MonoDebugMethodAddressList *
+mono_debugger_insert_method_breakpoint (MonoMethod *method, guint64 idx);
 
+int
+mono_debugger_remove_method_breakpoint (guint64 index);
 
+void
+mono_debugger_check_breakpoints (MonoMethod *method, MonoDebugMethodAddress *debug_info);
 
-void *
-mono_vtable_get_static_field_data (MonoVTable *vt);
+MonoClass *
+mono_debugger_register_class_init_callback (MonoImage *image, const gchar *full_name,
+                                           guint32 token, guint32 index);
 
-gchar *
-mono_debugger_check_runtime_version (const char *filename);
+void
+mono_debugger_remove_class_init_callback (int index);
 
 #endif /* __MONO_DEBUG_DEBUGGER_H__ */