* ssa.c: In mono_ssa_rename_vars, forced the creation of a new SSA
[mono.git] / mono / metadata / mono-debug-debugger.h
index 605b93bf6d2d297d0722abf299722b6cb3534535..71788262855dcc3b6006796a74d6be4829a7cc9e 100644 (file)
@@ -18,13 +18,17 @@ typedef struct _MonoDebuggerSymbolTable             MonoDebuggerSymbolTable;
 typedef struct _MonoDebuggerSymbolFile         MonoDebuggerSymbolFile;
 typedef struct _MonoDebuggerSymbolFilePriv     MonoDebuggerSymbolFilePriv;
 typedef struct _MonoDebuggerRangeInfo          MonoDebuggerRangeInfo;
+typedef struct _MonoDebuggerClassEntry         MonoDebuggerClassEntry;
 typedef struct _MonoDebuggerClassInfo          MonoDebuggerClassInfo;
+typedef struct _MonoDebuggerClassTable         MonoDebuggerClassTable;
 typedef struct _MonoDebuggerIOLayer            MonoDebuggerIOLayer;
 
 typedef enum {
        MONO_DEBUGGER_EVENT_BREAKPOINT,
        MONO_DEBUGGER_EVENT_RELOAD_SYMTABS,
-       MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION
+       MONO_DEBUGGER_EVENT_UNHANDLED_EXCEPTION,
+       MONO_DEBUGGER_EVENT_EXCEPTION,
+       MONO_DEBUGGER_EVENT_THROW_EXCEPTION
 } MonoDebuggerEvent;
 
 typedef enum {
@@ -38,9 +42,33 @@ typedef enum {
        MONO_DEBUGGER_TYPE_KIND_OBJECT,
        MONO_DEBUGGER_TYPE_KIND_STRUCT,
        MONO_DEBUGGER_TYPE_KIND_CLASS,
-       MONO_DEBUGGER_TYPE_KIND_CLASS_INFO
+       MONO_DEBUGGER_TYPE_KIND_CLASS_INFO,
+       MONO_DEBUGGER_TYPE_KIND_REFERENCE
 } MonoDebuggerTypeKind;
 
+typedef enum {
+       MONO_DEBUGGER_TYPE_UNKNOWN      = 0,
+       MONO_DEBUGGER_TYPE_VOID,
+       MONO_DEBUGGER_TYPE_BOOLEAN,
+       MONO_DEBUGGER_TYPE_CHAR,
+       MONO_DEBUGGER_TYPE_I1,
+       MONO_DEBUGGER_TYPE_U1,
+       MONO_DEBUGGER_TYPE_I2,
+       MONO_DEBUGGER_TYPE_U2,
+       MONO_DEBUGGER_TYPE_I4,
+       MONO_DEBUGGER_TYPE_U4,
+       MONO_DEBUGGER_TYPE_I8,
+       MONO_DEBUGGER_TYPE_U8,
+       MONO_DEBUGGER_TYPE_R4,
+       MONO_DEBUGGER_TYPE_R8,
+       MONO_DEBUGGER_TYPE_I,
+       MONO_DEBUGGER_TYPE_U,
+       MONO_DEBUGGER_TYPE_STRING,
+       MONO_DEBUGGER_TYPE_ARRAY,
+       MONO_DEBUGGER_TYPE_ENUM,
+       MONO_DEBUGGER_TYPE_MAX          = 100
+} MonoDebuggerType;
+
 struct _MonoDebuggerBreakpointInfo {
        guint32 index;
        MonoMethodDesc *desc;
@@ -48,8 +76,8 @@ struct _MonoDebuggerBreakpointInfo {
 
 struct _MonoDebuggerBuiltinTypeInfo
 {
+       MonoDebuggerClassEntry *centry;
        MonoClass *klass;
-       MonoDebuggerClassInfo *cinfo;
        guint32 type_info;
        guint32 class_info;
        guint8 *type_data;
@@ -59,6 +87,7 @@ struct _MonoDebuggerBuiltinTypes {
        guint32 total_size;
        guint32 type_info_size;
        MonoDebuggerBuiltinTypeInfo *object_type;
+       MonoDebuggerBuiltinTypeInfo *valuetype_type;
        MonoDebuggerBuiltinTypeInfo *byte_type;
        MonoDebuggerBuiltinTypeInfo *void_type;
        MonoDebuggerBuiltinTypeInfo *boolean_type;
@@ -78,6 +107,7 @@ struct _MonoDebuggerBuiltinTypes {
        MonoDebuggerBuiltinTypeInfo *enum_type;
        MonoDebuggerBuiltinTypeInfo *array_type;
        MonoDebuggerBuiltinTypeInfo *exception_type;
+       MonoDebuggerBuiltinTypeInfo *type_type;
 };
 
 struct _MonoDebuggerSymbolTable {
@@ -88,7 +118,6 @@ struct _MonoDebuggerSymbolTable {
        /*
         * Corlib and builtin types.
         */
-       MonoDomain *domain;
        MonoDebuggerSymbolFile *corlib;
        MonoDebuggerBuiltinTypes *builtin_types;
 
@@ -131,6 +160,17 @@ struct _MonoDebuggerSymbolTable {
         */
        guint32 type_table_offset;
        guint32 type_table_start;
+
+       /*
+        * New in version 44.
+        */
+       guint32 num_misc_tables;
+       guint32 misc_table_chunk_size;
+       gpointer *misc_tables;
+       gpointer current_misc_table;
+       guint32 misc_table_size;
+       guint32 misc_table_offset;
+       guint32 misc_table_start;
 };
 
 struct _MonoDebuggerSymbolFile {
@@ -145,9 +185,10 @@ struct _MonoDebuggerSymbolFile {
        MonoDebuggerRangeInfo *range_table;
        guint32 range_entry_size;
        guint32 num_range_entries;
-       /* Pointer to the malloced class table. */
-       MonoDebuggerClassInfo *class_table;
-       guint32 num_class_entries;
+       /* Pointer to the class table. */
+       guint32 class_table_size;
+       MonoDebuggerClassTable *current_class_table;
+       MonoDebuggerClassTable *class_table_start;
        /* Private. */
        MonoDebuggerSymbolFilePriv *_priv;
 };
@@ -160,6 +201,12 @@ struct _MonoDebuggerRangeInfo {
        guint32 dynamic_size;
 };
 
+struct _MonoDebuggerClassTable {
+       MonoDebuggerClassTable *next;
+       guint32 index, size;
+       MonoDebuggerClassInfo *data;
+};
+
 struct _MonoDebuggerClassInfo {
        MonoClass *klass;
        guint32 rank;
@@ -167,6 +214,16 @@ struct _MonoDebuggerClassInfo {
        guint32 type_info;
 };
 
+struct _MonoDebuggerClassEntry {
+       MonoDebuggerClassInfo *info;
+       guint32 type_reference;
+};
+
+enum {
+       MONO_DEBUGGER_MISC_ENTRY_TYPE_UNKNOWN   = 0,
+       MONO_DEBUGGER_MISC_ENTRY_TYPE_WRAPPER
+};
+
 extern MonoDebuggerSymbolTable *mono_debugger_symbol_table;
 
 /*
@@ -188,15 +245,16 @@ struct _MonoDebuggerIOLayer
        void (*EnterCriticalSection) (WapiCriticalSection *section);
        void (*LeaveCriticalSection) (WapiCriticalSection *section);
 
-       guint32 (*WaitForSingleObject) (gpointer handle, guint32 timeout);
+       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 waitall, guint32 timeout, gboolean alertable);
 
        gpointer (*CreateSemaphore) (WapiSecurityAttributes *security,
                                     gint32 initial, gint32 max,
-                                    const guchar *name);
+                                    const gunichar2 *name);
        gboolean (*ReleaseSemaphore) (gpointer handle, gint32 count, gint32 *prevcount);
 
        gpointer (*CreateThread) (WapiSecurityAttributes *security,
@@ -209,23 +267,32 @@ extern MonoDebuggerIOLayer mono_debugger_io_layer;
 
 #endif
 
-extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, gpointer data, guint32 arg);
+extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
-void            mono_debugger_initialize                  (MonoDomain *domain);
+void            mono_debugger_initialize                  (void);
 void            mono_debugger_cleanup                     (void);
 
 void            mono_debugger_lock                        (void);
 void            mono_debugger_unlock                      (void);
-void            mono_debugger_event                       (MonoDebuggerEvent event, gpointer data, guint32 arg);
+void            mono_debugger_event                       (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
+MonoDebuggerSymbolFile   *_mono_debugger_get_symfile      (MonoImage *image);
 MonoDebuggerSymbolFile   *mono_debugger_add_symbol_file   (MonoDebugHandle *handle);
-void                      mono_debugger_add_type          (MonoDebuggerSymbolFile *symfile, MonoClass *klass);
+void                      mono_debugger_start_add_type    (MonoDebuggerSymbolFile *symfile,
+                                                          MonoClass *klass);
+void                      mono_debugger_add_type          (MonoDebuggerSymbolFile *symfile,
+                                                          MonoClass *klass);
 MonoDebuggerBuiltinTypes *mono_debugger_add_builtin_types (MonoDebuggerSymbolFile *symfile);
 
 void            mono_debugger_add_method                  (MonoDebuggerSymbolFile *symfile,
                                                           MonoDebugMethodInfo *minfo,
                                                           MonoDebugMethodJitInfo *jit);
 
+void            mono_debugger_add_wrapper                 (MonoMethod *wrapper,
+                                                          MonoDebugMethodJitInfo *jit,
+                                                          gpointer addr);
+
+
 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);
@@ -239,7 +306,10 @@ MonoObject     *mono_debugger_runtime_invoke              (MonoMethod *method, v
 
 guint32         mono_debugger_lookup_type                 (const gchar *type_name);
 gint32          mono_debugger_lookup_assembly             (const gchar *name);
-gboolean        mono_debugger_unhandled_exception         (gpointer addr, MonoObject *exc);
+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);
+
 
 
 void *
@@ -258,4 +328,7 @@ ves_icall_MonoDebugger_GetLocalTypeFromSignature (MonoReflectionAssembly *assemb
 MonoReflectionType *
 ves_icall_MonoDebugger_GetType (MonoReflectionAssembly *assembly, guint32 token);
 
+gchar *
+mono_debugger_check_runtime_version (const char *filename);
+
 #endif /* __MONO_DEBUG_DEBUGGER_H__ */