diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj b/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj index 6e892ad37..05ae29021 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj @@ -1,132 +1,32 @@ - - + - Debug - AnyCPU 9.0.21022 - 2.0 - {372E8E3E-29D5-4B4D-88A2-4711CD628C4E} - Library - Mono.Debugger.Soft - Mono.Debugger.Soft True mono.snk + True + MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL + False + netstandard2.0 - True full - False bin\Debug - MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL - prompt - 4 - False - True True pdbonly - True bin\Release - prompt - 4 - False - MONO_DATACONVERTER_STATIC_METHODS;ENABLE_CECIL - True + + + 0.10.0-beta5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.10.1 - - - - - - + + - + \ No newline at end of file diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index d7c6bf091..5fb6bad10 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Text; using System.Diagnostics; +using System.Threading.Tasks; namespace Mono.Debugger.Soft { @@ -1597,7 +1598,7 @@ int Send (CommandSet command_set, int command, PacketWriter packet, Action cb (r)); }; reply_cb_counts [id] = count; } diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs index 022cbdcea..243dc079c 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/ObjectMirror.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Runtime.Remoting.Messaging; using System.Threading; using System.Threading.Tasks; diff --git a/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs b/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs index 141913a22..d85002f81 100644 --- a/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs +++ b/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachineManager.cs @@ -4,8 +4,8 @@ using System.IO; using System.Net; using System.Net.Sockets; -using System.Runtime.Remoting.Messaging; using System.Text; +using System.Threading.Tasks; namespace Mono.Debugger.Soft { @@ -69,12 +69,12 @@ public static VirtualMachine LaunchInternal (ITargetProcess p, ProcessStartInfo return vm; } - public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback callback) + public static Task BeginLaunch (ProcessStartInfo info, Action> callback) { return BeginLaunch (info, callback, null); } - public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback callback, LaunchOptions options) + public static Task BeginLaunch (ProcessStartInfo info, Action> callback, LaunchOptions options) { if (info == null) throw new ArgumentNullException ("info"); @@ -111,20 +111,19 @@ public static IAsyncResult BeginLaunch (ProcessStartInfo info, AsyncCallback cal socket.Close (); }; - LaunchCallback c = new LaunchCallback (LaunchInternal); - return c.BeginInvoke (p, info, socket, callback, socket); + Task t3 = Task.Run (() => { + return LaunchInternal (p, info, socket); + }); + t3.ContinueWith ((antecendent => callback (antecendent))); + return t3; } - public static VirtualMachine EndLaunch (IAsyncResult asyncResult) { + public static VirtualMachine EndLaunch (Task asyncResult) { if (asyncResult == null) throw new ArgumentNullException ("asyncResult"); - if (!asyncResult.IsCompleted) - asyncResult.AsyncWaitHandle.WaitOne (); - - AsyncResult result = (AsyncResult) asyncResult; - LaunchCallback cb = (LaunchCallback) result.AsyncDelegate; - return cb.EndInvoke (asyncResult); + asyncResult.Wait (); + return asyncResult.Result; } public static VirtualMachine Launch (ProcessStartInfo info) @@ -193,17 +192,17 @@ public static VirtualMachine ListenInternal (Socket dbg_sock, Socket con_sock) { return Connect (transport, console, null); } - public static IAsyncResult BeginListen (IPEndPoint dbg_ep, AsyncCallback callback) { + public static Task BeginListen (IPEndPoint dbg_ep, Action> callback) { return BeginListen (dbg_ep, null, callback); } - public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback) + public static Task BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, Action> callback) { int dbg_port, con_port; return BeginListen (dbg_ep, con_ep, callback, out dbg_port, out con_port); } - public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback, + public static Task BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, Action> callback, out int dbg_port, out int con_port) { dbg_port = con_port = 0; @@ -222,21 +221,22 @@ public static IAsyncResult BeginListen (IPEndPoint dbg_ep, IPEndPoint con_ep, As con_sock.Listen (1000); con_port = ((IPEndPoint) con_sock.LocalEndPoint).Port; } - - ListenCallback c = new ListenCallback (ListenInternal); - return c.BeginInvoke (dbg_sock, con_sock, callback, con_sock ?? dbg_sock); + + Task t = Task.Run (() => { + return ListenInternal (dbg_sock, con_sock); + }); + t.ContinueWith ((antecendent => callback (antecendent))); + return t; } - public static VirtualMachine EndListen (IAsyncResult asyncResult) { + public static VirtualMachine EndListen (Task asyncResult) { if (asyncResult == null) throw new ArgumentNullException ("asyncResult"); - if (!asyncResult.IsCompleted) - asyncResult.AsyncWaitHandle.WaitOne (); + asyncResult.Wait (); + - AsyncResult result = (AsyncResult) asyncResult; - ListenCallback cb = (ListenCallback) result.AsyncDelegate; - return cb.EndInvoke (asyncResult); + return asyncResult.Result; } public static VirtualMachine Listen (IPEndPoint dbg_ep) @@ -292,11 +292,11 @@ public static VirtualMachine ConnectInternal (Socket dbg_sock, Socket con_sock, return Connect (transport, console, null); } - public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, AsyncCallback callback) { + public static Task BeginConnect (IPEndPoint dbg_ep, Action> callback) { return BeginConnect (dbg_ep, null, callback); } - public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, AsyncCallback callback) { + public static Task BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, Action> callback) { Socket dbg_sock = null; Socket con_sock = null; @@ -305,21 +305,20 @@ public static IAsyncResult BeginConnect (IPEndPoint dbg_ep, IPEndPoint con_ep, A if (con_ep != null) { con_sock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); } - - ConnectCallback c = new ConnectCallback (ConnectInternal); - return c.BeginInvoke (dbg_sock, con_sock, dbg_ep, con_ep, callback, con_sock ?? dbg_sock); + + Task t3 = Task.Run (() => { + return ConnectInternal (dbg_sock, con_sock, dbg_ep, con_ep); + }); + t3.ContinueWith((antecendent => callback (antecendent))); + return t3; } - public static VirtualMachine EndConnect (IAsyncResult asyncResult) { + public static VirtualMachine EndConnect (Task asyncResult) { if (asyncResult == null) throw new ArgumentNullException ("asyncResult"); - if (!asyncResult.IsCompleted) - asyncResult.AsyncWaitHandle.WaitOne (); - - AsyncResult result = (AsyncResult) asyncResult; - ConnectCallback cb = (ConnectCallback) result.AsyncDelegate; - return cb.EndInvoke (asyncResult); + asyncResult.Wait (); + return asyncResult.Result; } public static void CancelConnection (IAsyncResult asyncResult) diff --git a/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj b/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj index 369830091..c41136ee1 100644 --- a/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj +++ b/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj @@ -1,91 +1,44 @@ - - + - Debug - AnyCPU - {DE40756E-57F6-4AF2-B155-55E3A88CCED8} - Library - Mono.Debugging.Soft - Mono.Debugging.Soft True ..\Mono.Debugging\mono.debugging.snk - v4.7.2 + netstandard2.0 + Mono.Debugging.Soft + bin\$(Configuration)\Mono.Debugging.Soft.xml + false + 1591;1573 - True full - False bin\Debug DEBUG - prompt - 4 - 1591;1573 - bin\Debug\Mono.Debugging.Soft.xml pdbonly - true bin\Release - prompt - 4 true - 1591;1573 - bin\Release\Mono.Debugging.Soft.xml - - - {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2} - Mono.Debugging - False - - - {372E8E3E-29D5-4B4D-88A2-4711CD628C4E} - Mono.Debugger.Soft - False - - - - - - - - - - - - - - - - - - - - - - - 2.10.0 - 0.10.1 + 0.10.0-beta5 + - - - - - 10.0.3 - + + + + + ICSharpCode + - - - - + + + + + - - - + \ No newline at end of file diff --git a/Mono.Debugging.Soft/Mono.Debugging.Soft.nuspec b/Mono.Debugging.Soft/Mono.Debugging.Soft.nuspec index ccbb80097..4916f6588 100644 --- a/Mono.Debugging.Soft/Mono.Debugging.Soft.nuspec +++ b/Mono.Debugging.Soft/Mono.Debugging.Soft.nuspec @@ -14,7 +14,6 @@ en-US mono debug debugger soft - diff --git a/Mono.Debugging.Soft/SoftDebuggerSession.cs b/Mono.Debugging.Soft/SoftDebuggerSession.cs index 02f0ac837..3aa97e291 100644 --- a/Mono.Debugging.Soft/SoftDebuggerSession.cs +++ b/Mono.Debugging.Soft/SoftDebuggerSession.cs @@ -26,6 +26,7 @@ // THE SOFTWARE. //#define DEBUG_EVENT_QUEUEING +extern alias ICSharpCode; using System; using System.IO; @@ -39,7 +40,7 @@ using System.Collections.Generic; using System.Runtime.InteropServices; -using Mono.CompilerServices.SymbolWriter; +using ICSharpCode::Mono.CompilerServices.SymbolWriter; using Mono.Debugging.Client; using Mono.Debugger.Soft; using Mono.Debugging.Evaluation; @@ -48,6 +49,7 @@ using Mono.Cecil.Cil; using Newtonsoft.Json; using System.Text.RegularExpressions; +using System.Threading.Tasks; namespace Mono.Debugging.Soft { @@ -290,11 +292,11 @@ protected void StartConnecting (SoftDebuggerStartInfo dsi, int maxAttempts, int IPEndPoint dbgEP, conEP; InitForRemoteSession (dsi, out dbgEP, out conEP); - AsyncCallback callback = null; + Action< Task> callback = null; int attemptNumber = 0; - callback = delegate (IAsyncResult ar) { + callback = delegate (Task ar) { try { - ConnectionStarted (VirtualMachineManager.EndConnect (ar)); + ConnectionStarted (ar.Result); return; } catch (Exception ex) { attemptNumber++; @@ -336,9 +338,9 @@ void InitForRemoteSession (SoftDebuggerStartInfo dsi, out IPEndPoint dbgEP, out } ///Catches errors in async callbacks and hands off to OnConnectionError - AsyncCallback HandleConnectionCallbackErrors (AsyncCallback callback) + Action> HandleConnectionCallbackErrors (Action> callback) { - return delegate (IAsyncResult ar) { + return delegate (Task ar) { connection = null; try { callback (ar); @@ -1264,7 +1266,7 @@ public void EnableException(string exceptionType, bool caught = true) foreach (TypeMirror t in vm.GetTypes (exceptionType, false)) ProcessType (t); } - catch (CommandException exc) { + catch (CommandException) { OnDebuggerOutput (false, string.Format ("Error while parsing type ‘{0}’.\n", exceptionType)); } } diff --git a/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs b/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs index 46165861c..9455a9dea 100644 --- a/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs +++ b/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs @@ -810,10 +810,12 @@ internal UpdateCallback GetUpdateCallback () ~ObjectValue () { +#if !NETSTANDARD2_0 if (updateCallback != null) System.Runtime.Remoting.RemotingServices.Disconnect ((UpdateCallbackProxy)updateCallback.Callback); +#endif } - + internal static void ConnectCallbacks (StackFrame parentFrame, params ObjectValue[] values) { Dictionary> callbacks = null; diff --git a/Mono.Debugging/Mono.Debugging.Evaluation/RemoteFrameObject.cs b/Mono.Debugging/Mono.Debugging.Evaluation/RemoteFrameObject.cs index e4411eb08..c3e2313e1 100644 --- a/Mono.Debugging/Mono.Debugging.Evaluation/RemoteFrameObject.cs +++ b/Mono.Debugging/Mono.Debugging.Evaluation/RemoteFrameObject.cs @@ -59,7 +59,9 @@ public static void DisconnectAll () { lock (connectedValues) { foreach (RemoteFrameObject val in connectedValues) { +#if !NETSTANDARD2_0 System.Runtime.Remoting.RemotingServices.Disconnect (val); +#endif IDisposable disp = val as IDisposable; if (disp != null) disp.Dispose (); diff --git a/Mono.Debugging/Mono.Debugging.csproj b/Mono.Debugging/Mono.Debugging.csproj index 522e53404..7b05e1bcc 100644 --- a/Mono.Debugging/Mono.Debugging.csproj +++ b/Mono.Debugging/Mono.Debugging.csproj @@ -1,152 +1,38 @@ - - + - Debug - AnyCPU 8.0.30703 - 2.0 - {90C99ADB-7D4B-4EB4-98C2-40BD1B14C7D2} - Library - Mono.Debugging True mono.debugging.snk - Mono.Debugging - v4.7.2 + netstandard2.0 + bin\$(Configuration)\Mono.Debugging.xml + False + 1591;1573 - True full - False bin\Debug DEBUG - prompt - 4 - False - 1591;1573 - bin\Debug\Mono.Debugging.xml + false pdbonly - true bin\Release - prompt - 4 - False true - 1591;1573 - bin\Release\Mono.Debugging.xml + true + - - - - - - - - {3B2A5653-EC97-4001-BB9B-D90F1AF2C371} - ICSharpCode.NRefactory - - - {53DCA265-3C3C-42F9-B647-F72BA678122B} - ICSharpCode.NRefactory.CSharp - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - 1.5.0 - + - - - + \ No newline at end of file diff --git a/UnitTests/MonoDevelop.Debugger.Tests.AppDomainClient/MonoDevelop.Debugger.Tests.AppDomainClient.csproj b/UnitTests/MonoDevelop.Debugger.Tests.AppDomainClient/MonoDevelop.Debugger.Tests.AppDomainClient.csproj index 539fdfafe..ef09c7e22 100644 --- a/UnitTests/MonoDevelop.Debugger.Tests.AppDomainClient/MonoDevelop.Debugger.Tests.AppDomainClient.csproj +++ b/UnitTests/MonoDevelop.Debugger.Tests.AppDomainClient/MonoDevelop.Debugger.Tests.AppDomainClient.csproj @@ -1,15 +1,12 @@ - - + Debug AnyCPU - {7A55BE57-81C9-45EC-9C7C-7F97D0508171} Exe - MonoDevelop.Debugger.Tests.AppDomainClient - MonoDevelop.Debugger.Tests.AppDomainClient - v4.5 - 8.0.30703 - 2.0 + MonoDevelop.Debugger.Tests.AppDomainClient + netcoreapp3.0 + 8.0.30703 + false true @@ -28,11 +25,4 @@ 4 true - - - - - - - - + diff --git a/UnitTests/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj b/UnitTests/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj index 5159eec96..c98ef10a0 100644 --- a/UnitTests/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj +++ b/UnitTests/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj @@ -1,15 +1,12 @@ - - + Debug AnyCPU - {8AFA4FB4-BD2D-478F-942B-7AE3451535BB} Library - MonoDevelop.Debugger.Tests.NonUserCodeTestLib - MonoDevelop.Debugger.Tests.NonUserCodeTestLib + netstandard2.0 + MonoDevelop.Debugger.Tests.NonUserCodeTestLib 8.0.30703 - 2.0 - v4.5 + false true @@ -30,11 +27,4 @@ false true - - - - - - - diff --git a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/BreakpointsAndStepping.cs b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/BreakpointsAndStepping.cs index 53b36992d..458115ba2 100644 --- a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/BreakpointsAndStepping.cs +++ b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/BreakpointsAndStepping.cs @@ -472,8 +472,8 @@ public EmptyClassWithConstructor () class EmptyClassWithoutConstructor { } - -#if !NETSTANDARD_2_0 +#if !NETCOREAPP3_0 +#if !NETSTANDARD2_0 public void TestBug53371 () { var domain1 = AppDomain.CreateDomain ("domain1", null, new AppDomainSetup () { ApplicationBase = "." }); @@ -494,7 +494,7 @@ public void TestBugDomainBreakpointNotBound() AppDomain.Unload (domain2); } #endif - +#endif class DontUseThisClassInOtherTests { //Or StaticConstructorStepping will fail because diff --git a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/MonoDevelop.Debugger.Tests.TestApp.csproj b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/MonoDevelop.Debugger.Tests.TestApp.csproj index 314f05ed4..1ada26208 100644 --- a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/MonoDevelop.Debugger.Tests.TestApp.csproj +++ b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/MonoDevelop.Debugger.Tests.TestApp.csproj @@ -1,90 +1,38 @@ - - + - Debug x86 - {05EDFE55-C8D1-47E4-BB61-0BC809CD82E2} Exe - MonoDevelop.Debugger.Tests.TestApp - MonoDevelop.Debugger.Tests.TestApp 8.0.30703 - 2.0 - v4.5 + netcoreapp3.0 + MonoDevelop.Debugger.Tests.TestApp + 1591;1573;219;414;168 + false - True full - False bin\Debug DEBUG - prompt - 4 - x86 - 1591;1573;219;414;168 - False pdbonly - true bin\Release - prompt - 4 - x86 - 1591;1573;219;414;168 true - False - True full - False bin\Debug DEBUG - prompt - 4 - AnyCPU - 1591;1573;219;414;168 - False pdbonly - true bin\Release - prompt - 4 - AnyCPU - 1591;1573;219;414;168 true - False - - - - - ..\MonoDevelop.Debugger.Tests.NonUserCodeTestLib\bin\Debug\MonoDevelop.Debugger.Tests.NonUserCodeTestLib.dll - - - - - - - - - - - - - {8AFA4FB4-BD2D-478F-942B-7AE3451535BB} - MonoDevelop.Debugger.Tests.NonUserCodeTestLib - False - - - {7A55BE57-81C9-45EC-9C7C-7F97D0508171} - MonoDevelop.Debugger.Tests.AppDomainClient - + + - + \ No newline at end of file diff --git a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs index 2abcd169b..9ec39c038 100644 --- a/UnitTests/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs +++ b/UnitTests/MonoDevelop.Debugger.Tests.TestApp/TestEvaluation.cs @@ -295,9 +295,11 @@ public void Test (string stringParam, int intParam = 22, int intParam2 = 66) }); action (); +#if !NETSTANDARD2_0 dynamic dynObj = new ExpandoObject (); dynObj.someInt = 53; dynObj.someString = "Hello dynamic objects!"; +#endif var objWithMethodA = new ClassWithMethodA ();