Browse Source

Fixed a bug that could cause the debugger to freeze. (ie. all debugee threads suspended)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5303 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
David Srbecký 16 years ago
parent
commit
85dc142e3b
  1. 13
      src/AddIns/Debugger/Debugger.Core/Process.cs

13
src/AddIns/Debugger/Debugger.Core/Process.cs

@ -447,22 +447,21 @@ namespace Debugger @@ -447,22 +447,21 @@ namespace Debugger
// It is not corProcess.GetHelperThreadID
// ICorDebugThread[] ts = new ICorDebugThread[corProcess.EnumerateThreads().GetCount()];
// corProcess.EnumerateThreads().Next((uint)ts.Length, ts);
try {
foreach(Thread t in this.Threads) {
t.CorThread.SetDebugState(CorDebugThreadState.THREAD_SUSPEND);
}
foreach(Thread t in threadsToRun) {
t.CorThread.SetDebugState(CorDebugThreadState.THREAD_RUN);
}
CorDebugThreadState state = Array.IndexOf(threadsToRun, t) == -1 ? CorDebugThreadState.THREAD_SUSPEND : CorDebugThreadState.THREAD_RUN;
try {
t.CorThread.SetDebugState(state);
} catch (COMException e) {
// The state of the thread is invalid. (Exception from HRESULT: 0x8013132D)
// It can happen for threads that have not started yet
// It can happen for example when thread has not started yet
if ((uint)e.ErrorCode == 0x8013132D) {
// TraceMessage("Can not suspend thread - The state of the thread is invalid. Thread ID = " + t.CorThread.GetID());
} else {
throw;
}
}
}
}
if (newThreadState != null) {
this.NewThreadState = newThreadState.Value;

Loading…
Cancel
Save