Revert "[sdb] Disallow nested invokes."
authorZoltan Varga <vargaz@gmail.com>
Wed, 2 Sep 2015 01:21:02 +0000 (21:21 -0400)
committerZoltan Varga <vargaz@gmail.com>
Wed, 2 Sep 2015 01:21:02 +0000 (21:21 -0400)
This reverts commit c4db814a44119462bc9029170790e1c445a93426.

Revert this, its supported functionality.

mcs/class/Mono.Debugger.Soft/Test/dtest-app.cs
mcs/class/Mono.Debugger.Soft/Test/dtest.cs
mono/mini/debugger-agent.c

index 645329ee98880604e4d38bf536a48ae2733c1e9f..b0cf1dfa13d29c06c943f2992fe15b05265b1307 100644 (file)
@@ -908,10 +908,6 @@ public class Tests : TestsBase, ITest2
        public void invoke2 () {
        }
 
-       [MethodImplAttribute (MethodImplOptions.NoInlining)]
-       public void invoke3 () {
-       }
-
        [MethodImplAttribute (MethodImplOptions.NoInlining)]
        public void invoke_ex () {
                invoke_ex_inner ();
index 3c62a78ee4f20b1751753ce79842028dd874ffad..0b47f1fbeb2c75de4f83067cd1412c5298cd8c63 100644 (file)
@@ -2506,53 +2506,6 @@ public class DebuggerTests
                        invoke_results.Add (res);
        }
 
-       [Test]
-       public void InvokeNested () {
-               Event e = run_until ("invoke1");
-
-               MethodMirror m = entry_point.DeclaringType.GetMethod ("invoke2");
-               Assert.IsNotNull (m);
-               vm.SetBreakpoint (m, 0);
-
-               StackFrame frame = e.Thread.GetFrames () [0];
-               var o = frame.GetThis () as ObjectMirror;
-
-               bool failed = false;
-
-               bool finished = false;
-               object wait = new object ();
-
-               Thread t = new Thread (delegate () {
-                               try {
-                                       o.InvokeMethod (e.Thread, m, null);
-                               } catch {
-                                       failed = true;
-                               }
-                               lock (wait) {
-                                       finished = true;
-                                       Monitor.Pulse (wait);
-                               }
-                       });
-
-               t.Start ();
-
-               StackFrame invoke_frame = null;
-
-               e = GetNextEvent ();
-               Assert.IsInstanceOfType (typeof (BreakpointEvent), e);
-
-               // Check that nested invokes are not allowed
-               AssertThrows<VMNotSuspendedException> (delegate {
-                       o.InvokeMethod (e.Thread, m, null);
-                       });
-
-               vm.Resume ();
-               lock (wait) {
-                       if (!finished)
-                               Monitor.Wait (wait);
-               }
-       }
-
        [Test]
        public void GetThreads () {
                vm.GetThreads ();
index 4582c57d4617b59740e012fd65e9b4d7426d796b..f0891b45658f21e4acc2fb55cb673c0634c07936 100644 (file)
@@ -7013,7 +7013,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
                 * Store the invoke data into tls, the thread will execute it after it is
                 * resumed.
                 */
-               if (tls->pending_invoke || tls->invoke)
+               if (tls->pending_invoke)
                        return ERR_NOT_SUSPENDED;
                tls->pending_invoke = g_new0 (InvokeData, 1);
                tls->pending_invoke->id = id;