Browse Source

Fixed SD2-1118: Trying to manualy close the debuggee while the Local variables pad is loading nodes throws exception.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3106 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
34c72f5b81
  1. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
  3. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs
  4. 24
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs
  5. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs
  6. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerException.cs

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -136,6 +136,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -136,6 +136,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
List<ListViewItem> items = CreateItems();
UpdateItems(items);
} catch(AbortedBecauseDebuggeeResumedException) {
} catch(System.Exception) {
if (debuggedProcess == null || debuggedProcess.HasExpired) {
// Process unexpectedly exited
} else {
throw;
}
}
}
}

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

@ -237,6 +237,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -237,6 +237,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
Utils.DoEvents(debuggedProcess.DebuggeeState);
TreeViewVarNode.SetContentRecursive(debuggedProcess, LocalVarList, new StackFrameNode(debuggedProcess.SelectedStackFrame).ChildNodes);
} catch(AbortedBecauseDebuggeeResumedException) {
} catch(System.Exception) {
if (debuggedProcess == null || debuggedProcess.HasExpired) {
// Process unexpectedly exited
} else {
throw;
}
} finally {
localVarList.EndUpdate();
}

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/RunningThreadsPad.cs

@ -135,6 +135,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -135,6 +135,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
RefreshThread(t);
}
} catch(AbortedBecauseDebuggeeResumedException) {
} catch(System.Exception) {
if (debuggedProcess == null || debuggedProcess.HasExpired) {
// Process unexpectedly exited
} else {
throw;
}
}
}
}

24
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Eval.cs

@ -135,23 +135,27 @@ namespace Debugger @@ -135,23 +135,27 @@ namespace Debugger
Value WaitForResult()
{
process.WaitForPause(TimeSpan.FromMilliseconds(500));
if (!Evaluated) {
state = EvalState.EvaluatedTimeOut;
process.TraceMessage("Aboring eval: " + Description);
corEval.Abort();
try {
process.WaitForPause(TimeSpan.FromMilliseconds(500));
if (!Evaluated) {
process.TraceMessage("Rude aboring eval: " + Description);
corEval.CastTo<ICorDebugEval2>().RudeAbort();
state = EvalState.EvaluatedTimeOut;
process.TraceMessage("Aboring eval: " + Description);
corEval.Abort();
process.WaitForPause(TimeSpan.FromMilliseconds(500));
if (!Evaluated) {
throw new DebuggerException("Evaluation can not be stopped");
process.TraceMessage("Rude aboring eval: " + Description);
corEval.CastTo<ICorDebugEval2>().RudeAbort();
process.WaitForPause(TimeSpan.FromMilliseconds(500));
if (!Evaluated) {
throw new DebuggerException("Evaluation can not be stopped");
}
}
}
process.WaitForPause();
return this.Result;
} catch (ProcessExitedException) {
throw new GetValueException("Process exited");
}
process.WaitForPause();
return this.Result;
}
internal void NotifyEvaluationComplete(bool successful)

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs

@ -267,7 +267,7 @@ namespace Debugger @@ -267,7 +267,7 @@ namespace Debugger
debugger.MTA2STA.WaitForCall();
debugger.MTA2STA.PerformAllCalls();
}
if (this.HasExpired) throw new DebuggerException("Process exited before pausing");
if (this.HasExpired) throw new ProcessExitedException();
}
public void WaitForPause(TimeSpan timeout)
@ -280,7 +280,7 @@ namespace Debugger @@ -280,7 +280,7 @@ namespace Debugger
debugger.MTA2STA.WaitForCall(timeLeft);
debugger.MTA2STA.PerformCall();
}
if (this.HasExpired) throw new DebuggerException("Process exited before pausing");
if (this.HasExpired) throw new ProcessExitedException();
}
/// <summary>

5
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/DebuggerException.cs

@ -15,4 +15,9 @@ namespace Debugger @@ -15,4 +15,9 @@ namespace Debugger
public DebuggerException(string message): base(message) {}
public DebuggerException(string message, System.Exception inner): base(message, inner) {}
}
public class ProcessExitedException: DebuggerException
{
public ProcessExitedException(): base("Process exited") {}
}
}

Loading…
Cancel
Save