Imported Upstream version 3.12.0

Former-commit-id: cf92446697332992ec36726e78eb8703e1f259d7
This commit is contained in:
Jo Shields
2015-01-13 10:44:36 +00:00
parent 8b9b85e7f5
commit 181b81b4a4
659 changed files with 12743 additions and 16300 deletions

View File

@@ -155,11 +155,12 @@ namespace Mono.Debugger.Soft
[Flags]
enum InvokeFlags {
NONE = 0x0,
DISABLE_BREAKPOINTS = 0x1,
SINGLE_THREADED = 0x2,
OUT_THIS = 0x4,
OUT_ARGS = 0x8,
NONE = 0,
DISABLE_BREAKPOINTS = 1,
SINGLE_THREADED = 2,
OUT_THIS = 4,
OUT_ARGS = 8,
VIRTUAL = 16,
}
enum ElementType {
@@ -416,7 +417,7 @@ namespace Mono.Debugger.Soft
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
internal const int MINOR_VERSION = 35;
internal const int MINOR_VERSION = 38;
enum WPSuspendPolicy {
NONE = 0,
@@ -584,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 {
@@ -2377,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
*/

View File

@@ -22,6 +22,11 @@ namespace Mono.Debugger.Soft
/*
* Return the values of out arguments
*/
ReturnOutArgs = 8
ReturnOutArgs = 8,
/*
* Do a virtual invoke
* Since protocol version 2.37
*/
Virtual = 16
}
}

View File

@@ -307,6 +307,8 @@ namespace Mono.Debugger.Soft
f |= InvokeFlags.OUT_THIS;
if ((options & InvokeOptions.ReturnOutArgs) != 0)
f |= InvokeFlags.OUT_ARGS;
if ((options & InvokeOptions.Virtual) != 0)
f |= InvokeFlags.VIRTUAL;
InvokeAsyncResult r = new InvokeAsyncResult { AsyncState = state, AsyncWaitHandle = new ManualResetEvent (false), VM = vm, Thread = thread, Callback = callback };
thread.InvalidateFrames ();

View 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;

View File

@@ -22,6 +22,10 @@ public class TestsBase
static string base_static_s = "C";
#pragma warning restore 0414
#pragma warning restore 0169
public virtual string virtual_method () {
return "V1";
}
}
public enum AnEnum {
@@ -1365,6 +1369,10 @@ public class Tests : TestsBase, ITest2
j = 5;
set_ip_2 ();
}
public override string virtual_method () {
return "V2";
}
}
class TypeLoadClass {

View File

@@ -2137,6 +2137,11 @@ public class DebuggerTests
v = this_obj.InvokeMethod (e.Thread, m, null);
AssertValue (42, v);
// virtual call
m = t.BaseType.GetMethod ("virtual_method");
v = this_obj.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
AssertValue ("V2", v);
#if NET_4_5
// instance
m = t.GetMethod ("invoke_pass_ref");
@@ -2864,8 +2869,10 @@ public class DebuggerTests
var frames = e.Thread.GetFrames ();
Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name);
Assert.AreEqual (domain, frames [0].Domain);
Assert.AreEqual ("invoke", frames [1].Method.Name);
Assert.AreEqual ("domains", frames [2].Method.Name);
Assert.AreEqual (vm.RootDomain, frames [2].Domain);
// Test breakpoints on already JITted methods in other domains
m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2");