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 f9eb2ac684..c8e3ed977d 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 @@ -197,6 +197,14 @@ namespace Debugger corProcess.Stop(uint.MaxValue); NotifyPaused(PausedReason.ForcedBreak); } + // This is necessary for detach + foreach(Thread t in this.Threads) { + foreach(Stepper s in t.Steppers) { + if (s.CorStepper.IsActive == 1) { + s.CorStepper.Deactivate(); + } + } + } corProcess.Detach(); NotifyHasExited(); } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs index 0650fce1c4..91579f3304 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs @@ -25,6 +25,10 @@ namespace Debugger public event EventHandler StepComplete; + public ICorDebugStepper CorStepper { + get { return corStepper; } + } + [Debugger.Tests.Ignore] public Process Process { get { return stackFrame.Process; }