diff options
author | Thays Grazia <thaystg@gmail.com> | 2020-03-27 01:04:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 01:04:09 +0300 |
commit | 93a2f4ea395c431ec61269b36e9a0f8c68a8e804 (patch) | |
tree | d2d721affc3c4aad908cc8e3234c08e4e279cf92 /mcs/class | |
parent | 0565f6e2c0e1e15f490ab0e7d4005d0e36abaa29 (diff) |
Fix suspend_policy that will be sent to debugger-libs, because on debugger-libs we want to resume the VM only when it's suspended, but we were sending the wrong suspend_policy in the case of EVENT_KIND_VM_START and mono is started with suspend=y. (#19330)
With this fix we can do this PR again: https://github.com/mono/debugger-libs/pull/264/
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/999375/
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs | 2 | ||||
-rw-r--r-- | mcs/class/Mono.Debugger.Soft/Test/dtest.cs | 29 |
2 files changed, 29 insertions, 2 deletions
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 3e2cf5f33af..03724b7f7bc 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -436,7 +436,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 54; + internal const int MINOR_VERSION = 55; enum WPSuspendPolicy { NONE = 0, diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index 60fcfe29c6f..473ce2f355e 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -5197,9 +5197,36 @@ public class DebuggerTests Assert.IsInstanceOfType (typeof (ArgumentException), ex); } } + + [Test] + public void CheckSuspendPolicySentWhenLaunchSuspendYes () { + vm.Exit (0); + var port = GetFreePort (); + // Launch the app using server=y,suspend=y + var pi = CreateStartInfo (dtest_app_path, "attach", $"--debugger-agent=transport=dt_socket,address=127.0.0.1:{port},server=y,suspend=y"); + pi.UseShellExecute = false; + var process = Diag.Process.Start (pi); - + string failMessage = null; + try { + vm = ConnectToPort (port); + + vm.EnableEvents (EventType.AssemblyLoad, EventType.ThreadStart); + var es = vm.GetNextEventSet (); + Assert.AreEqual (es.SuspendPolicy, SuspendPolicy.All); + Assert.AreEqual (EventType.VMStart, es[0].EventType); + } + catch (Exception ex) { + failMessage = ex.Message; + } + finally { + vm.Exit (0); + vm = null; + } + if (failMessage != null) + Assert.Fail (failMessage); + } #endif } // class DebuggerTests } // namespace |