Author: martin
Date: 2007-10-31 10:57:20 -0500 (Wed, 31 Oct 2007)
New Revision: 88570

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backend/MonoThreadManager.cs
Log:
2007-10-31  Martin Baulig  <[EMAIL PROTECTED]>

        Merged the Plophos branch.

        * backend/MonoThreadManager.cs: Reflect latest runtime changes.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2007-10-31 15:56:32 UTC (rev 88569)
+++ trunk/debugger/ChangeLog    2007-10-31 15:57:20 UTC (rev 88570)
@@ -2,6 +2,8 @@
 
        Merged the Plophos branch.
 
+       * backend/MonoThreadManager.cs: Reflect latest runtime changes.
+
        * backend/Inferior.cs
        (Inferior.ChildEvent): Added public readonly `CallbackData' field.
        (Inferior.CallMethod(long,long)): Take a `byte[]' and a `long'

Modified: trunk/debugger/backend/MonoThreadManager.cs
===================================================================
--- trunk/debugger/backend/MonoThreadManager.cs 2007-10-31 15:56:32 UTC (rev 
88569)
+++ trunk/debugger/backend/MonoThreadManager.cs 2007-10-31 15:57:20 UTC (rev 
88570)
@@ -44,14 +44,15 @@
                LoadModule,
                UnloadModule,
                DomainCreate,
-               DomainUnload
+               DomainUnload,
+
+               Trampoline      = 256
        }
 
        internal class MonoThreadManager
        {
                ThreadManager thread_manager;
                MonoDebuggerInfo debugger_info;
-               TargetAddress notification_address = TargetAddress.Null;
                Inferior inferior;
 
                public static MonoThreadManager Initialize (ThreadManager 
thread_manager,
@@ -81,12 +82,35 @@
                }
 
                AddressBreakpoint notification_bpt;
+               IntPtr mono_runtime_info;
 
+               [DllImport("monodebuggerserver")]
+               static extern IntPtr 
mono_debugger_server_initialize_mono_runtime (
+                       int address_size, long notification_address,
+                       long executable_code_buffer, int 
executable_code_buffer_size,
+                       long breakpoint_info_area, long breakpoint_table,
+                       int breakpoint_table_size);
+
                protected void initialize_notifications (Inferior inferior)
                {
-                       notification_address = inferior.ReadAddress 
(debugger_info.NotificationAddress);
-                       inferior.SetNotificationAddress (notification_address);
+                       TargetAddress notification_address = 
inferior.ReadAddress (
+                               debugger_info.NotificationAddress);
+                       TargetAddress executable_code_buffer = 
inferior.ReadAddress (
+                               debugger_info.ExecutableCodeBuffer);
 
+                       TargetAddress breakpoint_info_area = 
inferior.ReadAddress (
+                               debugger_info.BreakpointInfoArea);
+                       TargetAddress breakpoint_table = inferior.ReadAddress (
+                               debugger_info.BreakpointTable);
+
+                       mono_runtime_info = 
mono_debugger_server_initialize_mono_runtime (
+                               inferior.TargetAddressSize, 
notification_address.Address,
+                               executable_code_buffer.Address,
+                               debugger_info.ExecutableCodeBufferSize,
+                               breakpoint_info_area.Address, 
breakpoint_table.Address,
+                               debugger_info.BreakpointTableSize);
+                       inferior.SetRuntimeInfo (mono_runtime_info);
+
                        inferior.WriteInteger (debugger_info.DebuggerVersion, 
2);
 
                        if (notification_bpt != null) {
@@ -134,7 +158,8 @@
                int index;
                internal void ThreadCreated (SingleSteppingEngine sse)
                {
-                       sse.Inferior.SetNotificationAddress 
(notification_address);
+                       sse.Inferior.SetRuntimeInfo (mono_runtime_info);
+
                        if (++index < 3)
                                sse.SetDaemon ();
                }
@@ -167,7 +192,7 @@
                                                inferior.AddressDomain, 
cevent.Data2);
 
                                        TargetAddress lmf = 
inferior.ReadAddress (data + 8);
-                                       engine.SetLMFAddress (lmf);
+                                       engine.SetManagedThreadData (lmf, data 
+ 24);
 
                                        Report.Debug (DebugFlags.Threads,
                                                      "{0} managed thread 
created: {1:x} {2} {3} - {4}",
@@ -250,6 +275,10 @@
                                        csharp_language = null;
                                        break;
 
+                               case NotificationType.Trampoline:
+                                       resume_target = false;
+                                       return false;
+
                                default: {
                                        TargetAddress data = new TargetAddress (
                                                inferior.AddressDomain, 
cevent.Data1);
@@ -282,8 +311,8 @@
        internal class MonoDebuggerInfo
        {
                // These constants must match up with those in 
mono/mono/metadata/mono-debug.h
-               public const int  MinDynamicVersion = 62;
-               public const int  MaxDynamicVersion = 62;
+               public const int  MinDynamicVersion = 64;
+               public const int  MaxDynamicVersion = 64;
                public const long DynamicMagic      = 0x7aff65af4253d427;
 
                public readonly TargetAddress NotificationAddress;
@@ -300,13 +329,17 @@
                public readonly TargetAddress RunFinally;
                public readonly TargetAddress InsertBreakpoint;
                public readonly TargetAddress RemoveBreakpoint;
-               public readonly TargetAddress RuntimeClassInit;
                public readonly TargetAddress Attach;
                public readonly TargetAddress Detach;
                public readonly TargetAddress Initialize;
                public readonly TargetAddress GetLMFAddress;
                public readonly TargetAddress DebuggerVersion;
                public readonly TargetAddress ThreadTable;
+               public readonly TargetAddress ExecutableCodeBuffer;
+               public readonly int ExecutableCodeBufferSize;
+               public readonly TargetAddress BreakpointInfoArea;
+               public readonly TargetAddress BreakpointTable;
+               public readonly int BreakpointTableSize;
 
                public readonly MonoMetadataInfo MonoMetadataInfo;
 
@@ -363,11 +396,17 @@
                        LookupClass               = reader.ReadAddress ();
                        InsertBreakpoint          = reader.ReadAddress ();
                        RemoveBreakpoint          = reader.ReadAddress ();
-                       RuntimeClassInit          = reader.ReadAddress ();
 
                        DebuggerVersion           = reader.ReadAddress ();
                        ThreadTable               = reader.ReadAddress ();
 
+                       ExecutableCodeBuffer      = reader.ReadAddress ();
+                       BreakpointInfoArea        = reader.ReadAddress ();
+                       BreakpointTable           = reader.ReadAddress ();
+
+                       ExecutableCodeBufferSize  = reader.ReadInteger ();
+                       BreakpointTableSize       = reader.ReadInteger ();
+
                        MonoMetadataInfo = new MonoMetadataInfo (memory, 
metadata_info);
 
                        Report.Debug (DebugFlags.JitSymtab, this);
@@ -399,6 +438,7 @@
                public readonly int KlassByValArgOffset;
                public readonly int KlassGenericClassOffset;
                public readonly int KlassGenericContainerOffset;
+               public readonly int KlassVTableOffset;
                public readonly int FieldInfoSize;
                public readonly int FieldInfoTypeOffset;
                public readonly int FieldInfoOffsetOffset;
@@ -431,6 +471,9 @@
                public readonly int MonoMethodFlagsOffset;
                public readonly int MonoMethodInflatedOffset;
 
+               public readonly int MonoVTableKlassOffset;
+               public readonly int MonoVTableVTableOffset;
+
                public MonoMetadataInfo (TargetMemoryAccess memory, 
TargetAddress address)
                {
                        int size = memory.ReadInteger (address);
@@ -461,6 +504,8 @@
                        KlassByValArgOffset = reader.ReadInt32 ();
                        KlassGenericClassOffset = reader.ReadInt32 ();
                        KlassGenericContainerOffset = reader.ReadInt32 ();
+                       KlassVTableOffset = reader.ReadInt32 ();
+
                        FieldInfoSize = reader.ReadInt32 ();
                        FieldInfoTypeOffset = reader.ReadInt32 ();
                        FieldInfoOffsetOffset = reader.ReadInt32 ();
@@ -494,6 +539,9 @@
                        MonoMethodTokenOffset = reader.ReadInt32 ();
                        MonoMethodFlagsOffset = reader.ReadInt32 ();
                        MonoMethodInflatedOffset = reader.ReadInt32 ();
+
+                       MonoVTableKlassOffset = reader.ReadInt32 ();
+                       MonoVTableVTableOffset = reader.ReadInt32 ();
                }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to