From 654b301579f07f6ade56cee02920a8945ca42fa7 Mon Sep 17 00:00:00 2001 From: zoltan Date: Sat, 14 Nov 2009 01:21:01 +0000 Subject: [PATCH] 2009-11-14 Zoltan Varga * InvokeOptions.cs: Add SingleThreaded option, not yet works. * VirtualMachineManager.cs (Launch): Pass options to BeginLaunch. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/branches/mono-2-6/mcs@146198 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog | 4 ++++ class/Mono.Debugger.Soft/Mono.Debugger/Connection.cs | 7 ++++--- class/Mono.Debugger.Soft/Mono.Debugger/InvokeOptions.cs | 6 +++++- class/Mono.Debugger.Soft/Mono.Debugger/ObjectMirror.cs | 2 ++ class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog b/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog index b2b07f0d98..71ab32bdd4 100644 --- a/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog +++ b/class/Mono.Debugger.Soft/Mono.Debugger/ChangeLog @@ -1,5 +1,9 @@ 2009-11-14 Zoltan Varga + * 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 (). diff --git a/class/Mono.Debugger.Soft/Mono.Debugger/Connection.cs b/class/Mono.Debugger.Soft/Mono.Debugger/Connection.cs index ffb23e90a0..acf5ee42d4 100644 --- a/class/Mono.Debugger.Soft/Mono.Debugger/Connection.cs +++ b/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; diff --git a/class/Mono.Debugger.Soft/Mono.Debugger/InvokeOptions.cs b/class/Mono.Debugger.Soft/Mono.Debugger/InvokeOptions.cs index 927c0c1ab5..8ea79fa5fc 100644 --- a/class/Mono.Debugger.Soft/Mono.Debugger/InvokeOptions.cs +++ b/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 } } diff --git a/class/Mono.Debugger.Soft/Mono.Debugger/ObjectMirror.cs b/class/Mono.Debugger.Soft/Mono.Debugger/ObjectMirror.cs index 3034ca28cc..fab5c54394 100644 --- a/class/Mono.Debugger.Soft/Mono.Debugger/ObjectMirror.cs +++ b/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; diff --git a/class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs b/class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs index 6627aa0bd4..94a385c2e6 100644 --- a/class/Mono.Debugger.Soft/Mono.Debugger/VirtualMachineManager.cs +++ b/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) { -- 2.11.4.GIT