From 9c8d604831f92244fc5bb75754d16d68b1a84ff7 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Sun, 29 Jun 2008 13:12:19 +0000 Subject: [PATCH] Detaching from a process no longer causes the text editor to jump to the line of code where the process was paused just before detaching. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3153 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Control/NDebugger.cs | 15 ++------------- .../Project/Src/Control/Process-StateControl.cs | 10 ++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs index c9e7f52598..19f1eb14ad 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs @@ -172,20 +172,9 @@ namespace Debugger DeactivateBreakpoints(); // Detach all processes. - foreach (Process process in processCollection) { - if (!process.IsPaused) { - process.Break(); - } - process.CorProcess.Detach(); - } - - RemoveAllProcesses(); - } - - void RemoveAllProcesses() - { while (processCollection.Count > 0) { - RemoveProcess(processCollection[0]); + Process process = processCollection[0]; + process.Detach(); } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs index dc974b2550..c4f4786d4f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs @@ -185,6 +185,16 @@ namespace Debugger RaisePausedEvents(); } + public void Detach() + { + if (IsRunning) { + corProcess.Stop(uint.MaxValue); + NotifyPaused(PausedReason.ForcedBreak); + } + corProcess.Detach(); + NotifyHasExpired(); + } + #region Convenience methods public void Continue()