Permalink
Browse files

Improve leaving nested break states.

2010-02-24  Martin Baulig  <martin@ximian.com>

	* frontend/Main.cs: Don't deadlock when leaving a nested
	break state.

	* backend/SingleSteppingEngine.cs
	(SSE.ProcessEvent): On `ChildEventType.RUNTIME_INVOKE_DONE':
	terminate the current operation if it's different from the rti.

	* classes/Operation.cs
	(OperationCommandResult.Completed): Send the result before
	signalling the wait handle.

svn path=/trunk/debugger/; revision=152398
  • Loading branch information...
1 parent 702b7a2 commit 6d54d6eb891f58220ef08ce19112b8a2e1af82bc Martin Baulig committed Feb 24, 2010
Showing with 28 additions and 9 deletions.
  1. +13 −0 ChangeLog
  2. +5 −1 backend/SingleSteppingEngine.cs
  3. +1 −1 classes/Operation.cs
  4. +9 −7 frontend/Main.cs
View
@@ -1,5 +1,18 @@
2010-02-24 Martin Baulig <martin@ximian.com>
+ * frontend/Main.cs: Don't deadlock when leaving a nested
+ break state.
+
+ * backend/SingleSteppingEngine.cs
+ (SSE.ProcessEvent): On `ChildEventType.RUNTIME_INVOKE_DONE':
+ terminate the current operation if it's different from the rti.
+
+ * classes/Operation.cs
+ (OperationCommandResult.Completed): Send the result before
+ signalling the wait handle.
+
+2010-02-24 Martin Baulig <martin@ximian.com>
+
* backend/server/x86_64-arch.c
(server_ptrace_call_method_invoke): Set correct return address to
make this work even if the stack is executable.
@@ -288,8 +288,12 @@ public bool ProcessEvent (Inferior.ChildEvent cevent)
process.Debugger.OnLeaveNestedBreakState (this);
}
- if (current_operation != rti)
+ if (current_operation != rti) {
+ OperationCommandResult result = current_operation.Result as OperationCommandResult;
+ if (result != null)
+ result.Completed (this, null);
current_operation.Result.Completed ();
+ }
current_operation = rti;
TargetEventArgs args = rti.OperationCompleted (current_frame, false);
View
@@ -93,9 +93,9 @@ internal virtual void Completed (SingleSteppingEngine sse, TargetEventArgs args)
if (!IsCompleted) {
IsCompleted = true;
- Host.OperationCompleted (sse, args, ThreadingModel);
if (args != null)
Host.SendResult (sse, args);
+ Host.OperationCompleted (sse, args, ThreadingModel);
}
}
View
@@ -33,8 +33,8 @@ public class CommandLineInterpreter
get { return interrupt_event; }
}
- public ST.AutoResetEvent EnterNestedBreakStateEvent {
- get { return enter_nested_break_state_event; }
+ public ST.AutoResetEvent NestedBreakStateEvent {
+ get { return nested_break_state_event; }
}
Interpreter interpreter;
@@ -47,7 +47,7 @@ public class CommandLineInterpreter
ST.Thread main_thread;
ST.AutoResetEvent interrupt_event;
- ST.AutoResetEvent enter_nested_break_state_event;
+ ST.AutoResetEvent nested_break_state_event;
Stack<CommandLineInterpreter.MainLoop> main_loop_stack;
@@ -88,7 +88,7 @@ internal CommandLineInterpreter (DebuggerOptions options, bool is_interactive)
parser = new LineParser (engine);
interrupt_event = new ST.AutoResetEvent (false);
- enter_nested_break_state_event = new ST.AutoResetEvent (false);
+ nested_break_state_event = new ST.AutoResetEvent (false);
main_loop_stack = new Stack<MainLoop> ();
main_loop_stack.Push (new MainLoop (interpreter));
@@ -109,7 +109,7 @@ public CommandLineInterpreter (Interpreter interpreter)
parser = new LineParser (engine);
interrupt_event = new ST.AutoResetEvent (false);
- enter_nested_break_state_event = new ST.AutoResetEvent (false);
+ nested_break_state_event = new ST.AutoResetEvent (false);
main_loop_stack = new Stack<MainLoop> ();
main_loop_stack.Push (new MainLoop (interpreter));
@@ -178,7 +178,7 @@ void wait_for_completion ()
Report.Debug (DebugFlags.CLI, "{0} waiting for completion", loop);
ST.WaitHandle[] wait = new ST.WaitHandle[] {
- loop.CompletedEvent, interrupt_event, enter_nested_break_state_event
+ loop.CompletedEvent, interrupt_event, nested_break_state_event
};
int ret = ST.WaitHandle.WaitAny (wait);
@@ -197,7 +197,7 @@ public void EnterNestedBreakState ()
Report.Debug (DebugFlags.CLI, "{0} enter nested break state", loop);
- enter_nested_break_state_event.Set ();
+ nested_break_state_event.Set ();
}
public void LeaveNestedBreakState ()
@@ -206,6 +206,8 @@ public void LeaveNestedBreakState ()
nested.Completed = true;
Report.Debug (DebugFlags.CLI, "{0} leave nested break state", nested);
+
+ nested_break_state_event.Set ();
}
void main_thread_main ()

0 comments on commit 6d54d6e

Please sign in to comment.