From 5371ac4b7da2a9f4f54b919cf2136e23ac315a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Mon, 25 Jul 2005 10:15:44 +0000 Subject: [PATCH] Exception interception git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@249 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Debugger.AddIn/Project/Src/Service/ExceptionForm.cs | 2 +- .../Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs | 3 ++- .../Project/Src/Debugger/DebuggerEvents/PausedReason.cs | 5 +++-- .../Project/Src/Debugger/Internal/ManagedCallback.cs | 6 +++++- .../Debugger/Debugger.Core/Project/Src/Threads/Thread.cs | 6 ++++++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs index 56f5019b24..8af4d23101 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/ExceptionForm.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.SharpDevelop.Services // buttonIgnore // this.buttonIgnore.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.buttonIgnore.Enabled = false; + this.buttonIgnore.Enabled = true; this.buttonIgnore.Location = new System.Drawing.Point(372, 160); this.buttonIgnore.Name = "buttonIgnore"; this.buttonIgnore.Size = new System.Drawing.Size(91, 32); diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs index f54c96bbe7..7c920ae5ec 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs @@ -362,7 +362,8 @@ namespace ICSharpCode.SharpDevelop.Services e.ResumeDebuggingAfterEvent(); return; case ExceptionForm.Result.Ignore: - throw new NotImplementedException(); + debugger.CurrentThread.InterceptCurrentException(); + return; } } else { JumpToCurrentLine(); diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerEvents/PausedReason.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerEvents/PausedReason.cs index 813ed14c54..404d10a539 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerEvents/PausedReason.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerEvents/PausedReason.cs @@ -15,8 +15,9 @@ namespace DebuggerLibrary ControlCTrap, Exception, DebuggerError, - EvalComplete, + EvalComplete, CurrentThreadChanged, - CurrentFunctionChanged + CurrentFunctionChanged, + ExceptionIntercepted } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs index 307cbf66c2..4a7be6a100 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs @@ -410,7 +410,11 @@ namespace DebuggerLibrary { EnterCallback("ExceptionUnwind", pThread); - ExitCallback_Continue(); + if (dwEventType == CorDebugExceptionUnwindCallbackType.DEBUG_EXCEPTION_INTERCEPTED) { + ExitCallback_Paused(PausedReason.ExceptionIntercepted); + } else { + ExitCallback_Continue(); + } } public void FunctionRemapComplete(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFunction pFunction) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs index 64b78ec41a..605e2225d5 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs @@ -131,6 +131,12 @@ namespace DebuggerLibrary return lastName; } } + + public void InterceptCurrentException() + { + ((ICorDebugThread2)corThread).InterceptCurrentException(LastFunction.corILFrame); + process.Continue(); + } internal IList ActiveSteppers { get {