2006-09-14 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / mono-debug-debugger.h
index ae0453dec7e1cdacb87b655587e38bb914e08471..93b7b829885ab822a1afb6762ddd6ec587f61aa5 100644 (file)
@@ -1,23 +1,19 @@
 /*
- * 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 enum {
        MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE     = 1,
@@ -33,8 +29,11 @@ typedef enum {
        MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
        MONO_DEBUGGER_EVENT_THREAD_CREATED,
        MONO_DEBUGGER_EVENT_THREAD_ABORT,
+       MONO_DEBUGGER_EVENT_THREAD_EXITED,
        MONO_DEBUGGER_EVENT_THROW_EXCEPTION,
-       MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION
+       MONO_DEBUGGER_EVENT_HANDLE_EXCEPTION,
+       MONO_DEBUGGER_EVENT_REACHED_MAIN,
+       MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE
 } MonoDebuggerEvent;
 
 struct _MonoDebuggerBreakpointInfo {
@@ -42,39 +41,6 @@ struct _MonoDebuggerBreakpointInfo {
        MonoMethodDesc *desc;
 };
 
-/*
- * 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 [];
-
-/*
- * 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);
-};
-
 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
 void            mono_debugger_initialize                  (gboolean use_debugger);
@@ -86,13 +52,12 @@ void            mono_debugger_event                       (MonoDebuggerEvent eve
 
 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);
 
 int             mono_debugger_insert_breakpoint_full      (MonoMethodDesc *desc);
 int             mono_debugger_remove_breakpoint           (int breakpoint_id);
 void            mono_debugger_breakpoint_callback         (MonoMethod *method, guint32 idx);
 
-gpointer        mono_debugger_create_notification_function (gpointer *notification_address);
+guint8         *mono_debugger_create_notification_function(MonoCodeManager *codeman);
 
 MonoObject     *mono_debugger_runtime_invoke              (MonoMethod *method, void *obj,
                                                           void **params, MonoObject **exc);