diff options
author | Zoltan Varga <vargaz@gmail.com> | 2017-02-01 20:45:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-01 20:45:38 +0300 |
commit | 3ae33568bd0e1f904ac3cd9b4f71c194a974a00d (patch) | |
tree | 77e6b77e20bacef2aaab63b55139d636eab57375 /mcs/class/Mono.Debugger.Soft | |
parent | 66df37380c0e1adeff862814e02272f85e8e6c96 (diff) |
[sdb] Add a Domain property to AssemblyMirror. (#4309)
Diffstat (limited to 'mcs/class/Mono.Debugger.Soft')
3 files changed, 20 insertions, 2 deletions
diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs index 9b0af4c77d2..a83daab43cb 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs @@ -14,6 +14,7 @@ namespace Mono.Debugger.Soft ModuleMirror main_module; AssemblyName aname; AssemblyDefinition meta; + AppDomainMirror domain; Dictionary<string, long> typeCacheIgnoreCase = new Dictionary<string, long> (StringComparer.InvariantCultureIgnoreCase); Dictionary<string, long> typeCache = new Dictionary<string, long> (); @@ -50,6 +51,17 @@ namespace Mono.Debugger.Soft } } + // Since Protocol version 2.45 + public AppDomainMirror Domain { + get { + if (domain == null) { + vm.CheckProtocolVersion (2, 45); + domain = vm.GetDomain (vm.conn.Assembly_GetIdDomain (id)); + } + return domain; + } + } + public virtual AssemblyName GetName () { if (aname == null) { string name = vm.conn.Assembly_GetName (id); diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index 3a1af2dc088..e09132e2798 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -420,7 +420,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 44; + internal const int MINOR_VERSION = 45; enum WPSuspendPolicy { NONE = 0, @@ -532,7 +532,8 @@ namespace Mono.Debugger.Soft GET_MANIFEST_MODULE = 3, GET_OBJECT = 4, GET_TYPE = 5, - GET_NAME = 6 + GET_NAME = 6, + GET_DOMAIN = 7 } enum CmdModule { @@ -2114,6 +2115,10 @@ namespace Mono.Debugger.Soft return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_NAME, new PacketWriter ().WriteId (id)).ReadString (); } + internal long Assembly_GetIdDomain (long id) { + return SendReceive (CommandSet.ASSEMBLY, (int)CmdAssembly.GET_DOMAIN, new PacketWriter ().WriteId (id)).ReadId (); + } + /* * TYPE */ diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index ce74b4fd5fb..61b3e310881 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -3490,6 +3490,7 @@ public class DebuggerTests // d_method is from another domain MethodMirror d_method = (e as BreakpointEvent).Method; Assert.IsTrue (m != d_method); + Assert.AreEqual (domain, d_method.DeclaringType.Assembly.Domain); var frames = e.Thread.GetFrames (); Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name); |