From 275ea5e6cd5f0ba1b57f0a0cb54d3e46a665efd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Thu, 3 Dec 2009 19:53:22 +0000 Subject: [PATCH] Workaround for exception during removing of breakpoint (can not reproduce though) git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5290 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- src/AddIns/Debugger/Debugger.Core/Breakpoint.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/AddIns/Debugger/Debugger.Core/Breakpoint.cs b/src/AddIns/Debugger/Debugger.Core/Breakpoint.cs index 36f9f89f2a..5177c41633 100644 --- a/src/AddIns/Debugger/Debugger.Core/Breakpoint.cs +++ b/src/AddIns/Debugger/Debugger.Core/Breakpoint.cs @@ -7,6 +7,8 @@ using System; using System.Collections.Generic; +using System.Runtime.InteropServices; + using Debugger.Interop.CorDebug; namespace Debugger @@ -111,7 +113,20 @@ namespace Debugger internal void Deactivate() { foreach(ICorDebugFunctionBreakpoint corBreakpoint in corBreakpoints) { - corBreakpoint.Activate(0); + #if DEBUG + // Get repro + corBreakpoint.Activate(0); + #else + try { + corBreakpoint.Activate(0); + } catch(COMException e) { + // Sometimes happens, but we had not repro yet. + // 0x80131301: Process was terminated. + if ((uint)e.ErrorCode == 0x80131301) + continue; + throw; + } + #endif } corBreakpoints.Clear(); }