Просмотр исходного кода

2009-11-14 Zoltan Varga <[email protected]>

	* InvokeOptions.cs: Add SingleThreaded option, not yet works.

	* VirtualMachineManager.cs (Launch): Pass options to BeginLaunch.

svn path=/trunk/mcs/; revision=146197
Zoltan Varga 16 лет назад
Родитель
Сommit
7a587c730f

+ 4 - 0
mcs/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog

@@ -1,5 +1,9 @@
 2009-11-14  Zoltan Varga  <[email protected]>
 
+	* InvokeOptions.cs: Add SingleThreaded option, not yet works.
+
+	* VirtualMachineManager.cs (Launch): Pass options to BeginLaunch.
+
 	* ObjectMirror.cs TypeMirror.cs StructMirror.cs: Implement an async version of
 	InvokeMethod ().
 

+ 4 - 3
mcs/class/Mono.Debugger.Soft/Mono.Debugger/Connection.cs

@@ -99,7 +99,8 @@ namespace Mono.Debugger
 
 	enum InvokeFlags {
 		NONE = 0x0,
-		DISABLE_BREAKPOINTS = 0x1
+		DISABLE_BREAKPOINTS = 0x1,
+		SINGLE_THREADED = 0x2
 	}
 
 	class ValueImpl {
@@ -221,7 +222,7 @@ namespace Mono.Debugger
 		 * and the debuggee can communicate if they implement the same major version,
 		 * and the debuggee's minor version is <= the library's minor version.
 		 */
-		public const int MAJOR_VERSION = 1;
+		public const int MAJOR_VERSION = 2;
 		public const int MINOR_VERSION = 0;
 
 		enum WPSuspendPolicy {
@@ -1140,7 +1141,7 @@ namespace Mono.Debugger
 
 		public ValueImpl VM_InvokeMethod (long thread, long method, ValueImpl this_arg, ValueImpl[] arguments, InvokeFlags flags, out ValueImpl exc) {
 			exc = null;
-			PacketReader r = SendReceive (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments).WriteInt ((int)flags));
+			PacketReader r = SendReceive (CommandSet.VM, (int)CmdVM.INVOKE_METHOD, new PacketWriter ().WriteId (thread).WriteInt ((int)flags).WriteId (method).WriteValue (this_arg).WriteInt (arguments.Length).WriteValues (arguments));
 			if (r.ReadByte () == 0) {
 				exc = r.ReadValue ();
 				return null;

+ 5 - 1
mcs/class/Mono.Debugger.Soft/Mono.Debugger/InvokeOptions.cs

@@ -9,6 +9,10 @@ namespace Mono.Debugger
 		/*
 		 * Disable breakpoints on the thread doing the invoke
 		 */
-		DisableBreakpoints = 1
+		DisableBreakpoints = 1,
+		/*
+		 * Only resume the target thread during the invoke
+		 */
+		SingleThreaded = 2
 	}
 }

+ 2 - 0
mcs/class/Mono.Debugger.Soft/Mono.Debugger/ObjectMirror.cs

@@ -152,6 +152,8 @@ namespace Mono.Debugger
 
 			if ((options & InvokeOptions.DisableBreakpoints) != 0)
 				f |= InvokeFlags.DISABLE_BREAKPOINTS;
+			if ((options & InvokeOptions.SingleThreaded) != 0)
+				f |= InvokeFlags.SINGLE_THREADED;
 
 			try {
 				ValueImpl exc;

+ 1 - 1
mcs/class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs

@@ -94,7 +94,7 @@ namespace Mono.Debugger
 		}
 
 		public static VirtualMachine Launch (ProcessStartInfo info, LaunchOptions options = null) {
-			return EndLaunch (BeginLaunch (info, null, null));
+			return EndLaunch (BeginLaunch (info, null, options));
 		}
 
 		public static VirtualMachine Launch (string[] args, LaunchOptions options = null) {