[Mono.Debugger.Soft] Implement StackFrame.Domain
authorJb Evain <jbevain@microsoft.com>
Tue, 18 Nov 2014 13:10:53 +0000 (14:10 +0100)
committerJb Evain <jbevain@microsoft.com>
Tue, 18 Nov 2014 13:10:53 +0000 (14:10 +0100)
This property uses the new CMD_STACK_FRAME_GET_DOMAIN command
to retrieve and cache the domain in which the stack frame
is executing.

Bump the protocol version to match the runtime.

mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs
mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs

index a54315f175e5f4fc2f49ffb2f070c027bcc2d4a1..753f3910f83d9bd9e76a67093f4f790dd87b986e 100644 (file)
@@ -417,7 +417,7 @@ namespace Mono.Debugger.Soft
                 * with newer runtimes, and vice versa.
                 */
                internal const int MAJOR_VERSION = 2;
-               internal const int MINOR_VERSION = 37;
+               internal const int MINOR_VERSION = 38;
 
                enum WPSuspendPolicy {
                        NONE = 0,
@@ -585,7 +585,8 @@ namespace Mono.Debugger.Soft
                enum CmdStackFrame {
                        GET_VALUES = 1,
                        GET_THIS = 2,
-                       SET_VALUES = 3
+                       SET_VALUES = 3,
+                       GET_DOMAIN = 4,
                }
 
                enum CmdArrayRef {
@@ -2378,6 +2379,10 @@ namespace Mono.Debugger.Soft
                        SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values));
                }
 
+               internal long StackFrame_GetDomain (long thread_id, long id) {
+                       return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
+               }
+
                /*
                 * ARRAYS
                 */
index 7a6a34fa539c93bf6d58758def7f70f34bf88c50..8549a93700afaf54b7b1e67d4e40a93a842729f5 100644 (file)
@@ -7,6 +7,7 @@ namespace Mono.Debugger.Soft
        public class StackFrame : Mirror
        {
                ThreadMirror thread;
+               AppDomainMirror domain;
                MethodMirror method;
                int il_offset;
                Location location;
@@ -32,6 +33,16 @@ namespace Mono.Debugger.Soft
                        }
                }
 
+               public AppDomainMirror Domain {
+                       get {
+                               vm.CheckProtocolVersion (2, 38);
+                               if (domain == null)
+                                       domain = vm.GetDomain (vm.conn.StackFrame_GetDomain (thread.Id, Id));
+
+                               return domain;
+                       }
+               }
+
                public MethodMirror Method {
                        get {
                                return method;