dynamic_methods ();
user ();
type_load ();
+ regress ();
if (args.Length > 0 && args [0] == "domain-test")
/* This takes a lot of time, so execute it conditionally */
domains ();
var c2 = new TypeLoadClass2 ();
c2.ToString ();
}
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void regress () {
+ regress_2755 (DateTime.Now);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static unsafe void regress_2755 (DateTime d) {
+ int* buffer = stackalloc int [128];
+
+ regress_2755_2 ();
+
+ int sum = 0;
+ for (int i = 0; i < 128; ++i)
+ sum += buffer [i];
+
+ regress_2755_3 (sum);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void regress_2755_2 () {
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void regress_2755_3 (int sum) {
+ }
}
class TypeLoadClass {
pi.Arguments = String.Join (" ", args);
vm = VirtualMachineManager.Launch (pi, new LaunchOptions { AgentArgs = agent_args });
} else {
- Console.WriteLine ("Listening...");
- vm = VirtualMachineManager.Listen (new IPEndPoint (IPAddress.Any, 10000));
+ var ep = new IPEndPoint (IPAddress.Any, 10000);
+ Console.WriteLine ("Listening on " + ep + "...");
+ vm = VirtualMachineManager.Listen (ep);
}
var load_req = vm.CreateAssemblyLoadRequest ();
Assert.AreEqual (2, map.InterfaceMethods.Length);
Assert.AreEqual (2, map.TargetMethods.Length);
}
+
+ [Test]
+ public void StackAlloc_Breakpoints_Regress2775 () {
+ // Check that breakpoints on arm don't overwrite stackalloc-ed memory
+ var e = run_until ("regress_2755");
+
+ var frame = e.Thread.GetFrames () [0];
+ var m = e.Method;
+ // This breaks at the call site
+ vm.SetBreakpoint (m, m.Locations [2].ILOffset);
+
+ vm.Resume ();
+ var e2 = GetNextEvent ();
+ Assert.IsTrue (e2 is BreakpointEvent);
+
+ e = run_until ("regress_2755_3");
+ frame = e.Thread.GetFrames () [1];
+ var res = frame.GetValue (m.GetLocal ("sum"));
+ AssertValue (0, res);
+ }
}