Author: martin
Date: 2006-04-25 08:06:51 -0400 (Tue, 25 Apr 2006)
New Revision: 59844
Modified:
trunk/mono/mono/mini/ChangeLog
trunk/mono/mono/mini/debug-debugger.c
trunk/mono/mono/mini/debug-debugger.h
Log:
2006-04-25 Martin Baulig <[EMAIL PROTECTED]>
* debug-debugger.h (MonoDebuggerInfo): Replaced `get_thread_id'
with `get_current_thread' and added `detach'.
(MonoDebuggerMetadataInfo): Added `thread_size',
`thread_tid_offset', `thread_stack_ptr_offset' and
`thread_end_stack_offset'.
Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog 2006-04-25 12:04:16 UTC (rev 59843)
+++ trunk/mono/mono/mini/ChangeLog 2006-04-25 12:06:51 UTC (rev 59844)
@@ -1,3 +1,11 @@
+2006-04-25 Martin Baulig <[EMAIL PROTECTED]>
+
+ * debug-debugger.h (MonoDebuggerInfo): Replaced `get_thread_id'
+ with `get_current_thread' and added `detach'.
+ (MonoDebuggerMetadataInfo): Added `thread_size',
+ `thread_tid_offset', `thread_stack_ptr_offset' and
+ `thread_end_stack_offset'.
+
2006-04-25 Zoltan Varga <[EMAIL PROTECTED]>
* aot.c Makefile.am: Split aot.c into two new files aot-compiler.c and
Modified: trunk/mono/mono/mini/debug-debugger.c
===================================================================
--- trunk/mono/mono/mini/debug-debugger.c 2006-04-25 12:04:16 UTC (rev
59843)
+++ trunk/mono/mono/mini/debug-debugger.c 2006-04-25 12:06:51 UTC (rev
59844)
@@ -24,8 +24,9 @@
static guint64 debugger_lookup_type (guint64 dummy_argument, const gchar
*string_argument);
static guint64 debugger_lookup_assembly (guint64 dummy_argument, const gchar
*string_argument);
static guint64 debugger_run_finally (guint64 argument1, guint64 argument2);
-static guint64 debugger_get_thread_id (void);
+static guint64 debugger_get_current_thread (void);
static void debugger_attach (void);
+static void debugger_detach (void);
static void debugger_initialize (void);
static void (*mono_debugger_notification_function) (guint64 command, guint64
data, guint64 data2);
@@ -37,6 +38,10 @@
sizeof (MonoType),
sizeof (MonoArrayType),
sizeof (MonoClass),
+ sizeof (MonoThread),
+ G_STRUCT_OFFSET (MonoThread, tid),
+ G_STRUCT_OFFSET (MonoThread, stack_ptr),
+ G_STRUCT_OFFSET (MonoThread, end_stack),
G_STRUCT_OFFSET (MonoClass, instance_size),
G_STRUCT_OFFSET (MonoClass, parent),
G_STRUCT_OFFSET (MonoClass, type_token),
@@ -97,8 +102,9 @@
&debugger_lookup_type,
&debugger_lookup_assembly,
&debugger_run_finally,
- &debugger_get_thread_id,
+ &debugger_get_current_thread,
&debugger_attach,
+ &debugger_detach,
&debugger_initialize
};
@@ -237,22 +243,31 @@
}
static guint64
-debugger_get_thread_id (void)
+debugger_get_current_thread (void)
{
- return GetCurrentThreadId ();
+ return (guint64) (gsize) mono_thread_current ();
}
static void
debugger_attach (void)
{
mono_debugger_init ();
- mono_debugger_create_all_threads ();
mono_debugger_event_handler = debugger_event_handler;
mono_debugger_notification_function
(MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE, 0, 0);
+
+ mono_debugger_init_threads ();
}
static void
+debugger_detach (void)
+{
+ mono_debugger_event_handler = NULL;
+ mono_debugger_notification_function = NULL;
+ mono_debugger_finalize_threads ();
+}
+
+static void
debugger_initialize (void)
{
}
@@ -317,7 +332,7 @@
MainThreadArgs main_args;
MonoImage *image;
- mono_debugger_init_threads (&main_args);
+ mono_debugger_init_threads ();
/*
* Get and compile the main function.
Modified: trunk/mono/mono/mini/debug-debugger.h
===================================================================
--- trunk/mono/mono/mini/debug-debugger.h 2006-04-25 12:04:16 UTC (rev
59843)
+++ trunk/mono/mono/mini/debug-debugger.h 2006-04-25 12:06:51 UTC (rev
59844)
@@ -48,8 +48,9 @@
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);
- guint64 (*get_thread_id) (void);
+ guint64 (*get_current_thread) (void);
void (*attach) (void);
+ void (*detach) (void);
void (*initialize) (void);
};
@@ -60,6 +61,10 @@
int type_size;
int array_type_size;
int klass_size;
+ int thread_size;
+ int thread_tid_offset;
+ int thread_stack_ptr_offset;
+ int thread_end_stack_offset;
int klass_instance_size_offset;
int klass_parent_offset;
int klass_token_offset;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches