Browse Source

Backported r5296 - Fixed "0x8013132E - This process has already been attached to"

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5316 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
David Srbecký 16 years ago
parent
commit
aa7f962410
  1. 19
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

19
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -233,9 +233,22 @@ namespace ICSharpCode.SharpDevelop.Services @@ -233,9 +233,22 @@ namespace ICSharpCode.SharpDevelop.Services
if (DebugStarting != null)
DebugStarting(this, EventArgs.Empty);
Process process = debugger.Attach(existingProcess);
attached = true;
SelectProcess(process);
try {
Process process = debugger.Attach(existingProcess);
attached = true;
SelectProcess(process);
} catch (System.Exception e) {
// CORDBG_E_DEBUGGER_ALREADY_ATTACHED
if (e is COMException || e is UnauthorizedAccessException) {
string msg = StringParser.Parse("${res:XML.MainMenu.DebugMenu.Error.CannotAttachToProcess}");
MessageService.ShowMessage(msg + " " + e.Message);
if (DebugStopped != null)
DebugStopped(this, EventArgs.Empty);
} else {
throw;
}
}
}
}

Loading…
Cancel
Save