Permalink
Browse files

Implemented nested break states.

2009-03-04  Martin Baulig  <martin@ximian.com>

	Implemented nested break states.

	* backend/SingleSteppingEngine.cs
	(SSE.ProcessChildEvent): Largely rework this to support nested
	break states.
	(SSE.Operation.EventResult): Added `SuspendOperation'.
	(SSE.Operation.CompletedOperation): New public virtual method.
	Compute the new stack frame here and also check for method operations.
	(SSE.InterruptibleOperation): New public abstract base class for
	operations which may be suspended in a nested break state.
	(SSE.OperationRuntimeInvoke): Derive from `InterruptibleOperation'.
	Moved all the low-level callbacks into a new private helper
	operation `OperationRuntimeInvokeHelper'.
	(SSE.OperationException): Return `EventResult.SuspendOperation' on
	completion to allow entering a nested break state; CompletedOperation()
	will check whether we may actually do that and fall back to a
	normal completion otherwise.

	* classes/Debugger.cs
	(Debugger.EnterNestedBreakStateEvent): New public event.
	(Debugger.LeaveNestedBreakStateEvent): New public event.

	* classes/DebuggerConfiguration.cs
	(DebuggerConfiguration.NestedBreakStates): New configuration option.

	* classes/ExpressionEvaluator.cs
	(EE.EvaluationFlags): New public enum.
	(EE.IExpression): New public interface.
	(EE.IEvaluator): New public interface.
	(EE.EvaluationCallback): New public delegate.
	(EE.MonoObjectToString): Add `EvaluationFlags' argument.
	(EE.GetProperty): Add `EvaluationFlags' argument.

	* classes/TargetEvent.cs
	(TargetEventType): Added `RuntimeInvokeDone'.  This is only sent
	if explicitly requested via `RuntimeInvokeFlags.SendEventOnCompletion'.

	* classes/Thread.cs
	(RuntimeInvokeFlags): New public enum.
	(Thread.RuntimeInvoke): Replaced `is_virtual' and `debug' by
	`RuntimeInvokeFlags flags'.

	* frontend/Main.cs: Reworked the main loop to support nested break
	states.

	* frontend/Command.cs
	(PrintExpressionCommand): Add `-nested-break' argument.

	* backend/Inferior.cs
	(Inferior.AbortInvoke): Added `out long aborted_rti' argument.

	* backend/server/x86-ptrace.c
	(server_ptrace_abort_invoke): Added `guint64 *aborted_rti'.

svn path=/trunk/debugger/; revision=128551
  • Loading branch information...
1 parent 92fb53c commit 801eef6f2bea648ba279eb3d27677e2326722167 Martin Baulig committed Mar 4, 2009
View
@@ -1,3 +1,59 @@
+2009-03-04 Martin Baulig <martin@ximian.com>
+
+ Implemented nested break states.
+
+ * backend/SingleSteppingEngine.cs
+ (SSE.ProcessChildEvent): Largely rework this to support nested
+ break states.
+ (SSE.Operation.EventResult): Added `SuspendOperation'.
+ (SSE.Operation.CompletedOperation): New public virtual method.
+ Compute the new stack frame here and also check for method operations.
+ (SSE.InterruptibleOperation): New public abstract base class for
+ operations which may be suspended in a nested break state.
+ (SSE.OperationRuntimeInvoke): Derive from `InterruptibleOperation'.
+ Moved all the low-level callbacks into a new private helper
+ operation `OperationRuntimeInvokeHelper'.
+ (SSE.OperationException): Return `EventResult.SuspendOperation' on
+ completion to allow entering a nested break state; CompletedOperation()
+ will check whether we may actually do that and fall back to a
+ normal completion otherwise.
+
+ * classes/Debugger.cs
+ (Debugger.EnterNestedBreakStateEvent): New public event.
+ (Debugger.LeaveNestedBreakStateEvent): New public event.
+
+ * classes/DebuggerConfiguration.cs
+ (DebuggerConfiguration.NestedBreakStates): New configuration option.
+
+ * classes/ExpressionEvaluator.cs
+ (EE.EvaluationFlags): New public enum.
+ (EE.IExpression): New public interface.
+ (EE.IEvaluator): New public interface.
+ (EE.EvaluationCallback): New public delegate.
+ (EE.MonoObjectToString): Add `EvaluationFlags' argument.
+ (EE.GetProperty): Add `EvaluationFlags' argument.
+
+ * classes/TargetEvent.cs
+ (TargetEventType): Added `RuntimeInvokeDone'. This is only sent
+ if explicitly requested via `RuntimeInvokeFlags.SendEventOnCompletion'.
+
+ * classes/Thread.cs
+ (RuntimeInvokeFlags): New public enum.
+ (Thread.RuntimeInvoke): Replaced `is_virtual' and `debug' by
+ `RuntimeInvokeFlags flags'.
+
+ * frontend/Main.cs: Reworked the main loop to support nested break
+ states.
+
+ * frontend/Command.cs
+ (PrintExpressionCommand): Add `-nested-break' argument.
+
+ * backend/Inferior.cs
+ (Inferior.AbortInvoke): Added `out long aborted_rti' argument.
+
+ * backend/server/x86-ptrace.c
+ (server_ptrace_abort_invoke): Added `guint64 *aborted_rti'.
+
2009-03-02 Martin Baulig <martin@ximian.com>
* frontend/Command.cs
View
@@ -116,7 +116,7 @@ internal class Inferior : TargetAccess, ITargetNotification, IDisposable
static extern TargetError mono_debugger_server_mark_rti_frame (IntPtr handle);
[DllImport("monodebuggerserver")]
- static extern TargetError mono_debugger_server_abort_invoke (IntPtr handle, long stack_pointer);
+ static extern TargetError mono_debugger_server_abort_invoke (IntPtr handle, long stack_pointer, out long aborted_rti);
[DllImport("monodebuggerserver")]
static extern TargetError mono_debugger_server_call_method_invoke (IntPtr handle, long invoke_method, long method_address, int num_params, int blob_size, IntPtr param_data, IntPtr offset_data, IntPtr blob_data, long callback_argument, bool debug);
@@ -203,6 +203,7 @@ internal enum ChildEventType {
CHILD_CALLED_EXIT,
CHILD_NOTIFICATION,
CHILD_INTERRUPTED,
+ RUNTIME_INVOKE_DONE,
UNHANDLED_EXCEPTION = 4001,
THROW_EXCEPTION,
@@ -509,10 +510,10 @@ public void MarkRuntimeInvokeFrame ()
check_error (mono_debugger_server_mark_rti_frame (server_handle));
}
- public bool AbortInvoke (TargetAddress stack_pointer)
+ public bool AbortInvoke (TargetAddress stack_pointer, out long aborted_rti)
{
TargetError result = mono_debugger_server_abort_invoke (
- server_handle, stack_pointer.Address);
+ server_handle, stack_pointer.Address, out aborted_rti);
if (result == TargetError.NoCallbackFrame)
return false;
check_error (result);
@@ -705,6 +706,7 @@ public ChildEvent ProcessEvent (int status)
case ChildEventType.CHILD_CALLBACK:
case ChildEventType.CHILD_CALLBACK_COMPLETED:
+ case ChildEventType.RUNTIME_INVOKE_DONE:
case ChildEventType.CHILD_STOPPED:
case ChildEventType.CHILD_INTERRUPTED:
case ChildEventType.CHILD_HIT_BREAKPOINT:
View
@@ -681,6 +681,16 @@ internal void OnTargetEvent (SingleSteppingEngine sse, TargetEventArgs args)
client.OnTargetEvent (sse, args);
}
+ internal void OnEnterNestedBreakState (SingleSteppingEngine sse)
+ {
+ client.OnEnterNestedBreakState (sse);
+ }
+
+ internal void OnLeaveNestedBreakState (SingleSteppingEngine sse)
+ {
+ client.OnLeaveNestedBreakState (sse);
+ }
+
//
// IDisposable
//
Oops, something went wrong.

0 comments on commit 801eef6

Please sign in to comment.