From 33a981042f2605ce299ba051642a579c4e492f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Thu, 12 Nov 2009 22:48:00 +0000 Subject: [PATCH] Hopefully fixed the bug with invalid "__exception" git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5252 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- src/AddIns/Debugger/Debugger.Core/Eval.cs | 4 ++-- .../Interop/CorSymExtensionMethods.cs | 2 +- .../Debugger/Debugger.Core/ManagedCallback.cs | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.Core/Eval.cs b/src/AddIns/Debugger/Debugger.Core/Eval.cs index b80f9cce7e..ffccb279f9 100644 --- a/src/AddIns/Debugger/Debugger.Core/Eval.cs +++ b/src/AddIns/Debugger/Debugger.Core/Eval.cs @@ -170,11 +170,11 @@ namespace Debugger process.WaitForPause(TimeSpan.FromMilliseconds(500)); if (!Evaluated) { state = EvalState.EvaluatedTimeOut; - process.TraceMessage("Aboring eval: " + Description); + process.TraceMessage("Aborting eval: " + Description); this.CorEval.Abort(); process.WaitForPause(TimeSpan.FromMilliseconds(500)); if (!Evaluated) { - process.TraceMessage("Rude aboring eval: " + Description); + process.TraceMessage("Rude aborting eval: " + Description); this.CorEval2.RudeAbort(); process.WaitForPause(TimeSpan.FromMilliseconds(500)); if (!Evaluated) { diff --git a/src/AddIns/Debugger/Debugger.Core/Interop/CorSymExtensionMethods.cs b/src/AddIns/Debugger/Debugger.Core/Interop/CorSymExtensionMethods.cs index e71ab1c27f..b31ba9e309 100644 --- a/src/AddIns/Debugger/Debugger.Core/Interop/CorSymExtensionMethods.cs +++ b/src/AddIns/Debugger/Debugger.Core/Interop/CorSymExtensionMethods.cs @@ -126,7 +126,7 @@ namespace Debugger.Interop.CorSym uint count; symScope.GetNamespaces(0, out count, new ISymUnmanagedNamespace[0]); ISymUnmanagedNamespace[] namespaces = new ISymUnmanagedNamespace[count]; - symScope.GetNamespaces(0, out count, namespaces); + symScope.GetNamespaces(count, out count, namespaces); return namespaces; } diff --git a/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs b/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs index 42c974b1ca..5ae4b243c5 100644 --- a/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs +++ b/src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs @@ -490,14 +490,13 @@ namespace Debugger // Watch out for the zeros and null! // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0); - process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException())); - process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState; - process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType; - process.SelectedThread.CurrentExceptionIsUnhandled = (ExceptionType)exceptionType == ExceptionType.Unhandled; - - if (process.SelectedThread.CurrentExceptionIsUnhandled || - process.PauseOnHandledException) - { + if (process.SelectedThread.CurrentExceptionIsUnhandled || process.PauseOnHandledException) { + process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException())); + process.SelectedThread.CurrentException.MakeValuePermanent(); + process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState; + process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType; + process.SelectedThread.CurrentExceptionIsUnhandled = (ExceptionType)exceptionType == ExceptionType.Unhandled; + pauseOnNextExit = true; } ExitCallback();