Browse Source

After attaching to a process the stop menu will now show a dialog asking whether the process should be terminated or detached.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3172 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 17 years ago
parent
commit
35b252484c
  1. BIN
      data/resources/StringResources.nl.resources
  2. 39
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  3. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

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

@ -57,7 +57,14 @@ namespace ICSharpCode.SharpDevelop.Services @@ -57,7 +57,14 @@ namespace ICSharpCode.SharpDevelop.Services
{
public class WindowsDebugger : IDebugger
{
enum StopAttachedProcessDialogResult {
Detach = 0,
Terminate = 1,
Cancel = 2
}
bool useRemotingForThreadInterop = false;
bool attached;
NDebugger debugger;
@ -114,6 +121,12 @@ namespace ICSharpCode.SharpDevelop.Services @@ -114,6 +121,12 @@ namespace ICSharpCode.SharpDevelop.Services
}
}
public bool IsAttached {
get {
return ServiceInitialized && attached;
}
}
public bool IsProcessRunning {
get {
return IsDebugging && debuggedProcess.IsRunning;
@ -145,6 +158,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -145,6 +158,7 @@ namespace ICSharpCode.SharpDevelop.Services
} else if (debugger.IsKernelDebuggerEnabled) {
MessageService.ShowMessage("${res:XML.MainMenu.DebugMenu.Error.KernelDebuggerEnabled}");
} else {
attached = false;
if (DebugStarting != null)
DebugStarting(this, EventArgs.Empty);
@ -182,6 +196,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -182,6 +196,7 @@ namespace ICSharpCode.SharpDevelop.Services
DebugStarting(this, EventArgs.Empty);
Debugger.Process process = debugger.Attach(existingProcess);
attached = true;
SelectProcess(process);
}
}
@ -202,7 +217,21 @@ namespace ICSharpCode.SharpDevelop.Services @@ -202,7 +217,21 @@ namespace ICSharpCode.SharpDevelop.Services
MessageService.ShowMessage(errorNotDebugging, "${res:XML.MainMenu.DebugMenu.Stop}");
return;
}
debuggedProcess.Terminate();
if (IsAttached) {
StopAttachedProcessDialogResult result = ShowStopAttachedProcessDialog();
switch (result) {
case StopAttachedProcessDialogResult.Terminate:
debuggedProcess.Terminate();
attached = false;
break;
case StopAttachedProcessDialogResult.Detach:
Detach();
attached = false;
break;
}
} else {
debuggedProcess.Terminate();
}
}
// ExecutionControl:
@ -580,5 +609,13 @@ namespace ICSharpCode.SharpDevelop.Services @@ -580,5 +609,13 @@ namespace ICSharpCode.SharpDevelop.Services
}
}
}
StopAttachedProcessDialogResult ShowStopAttachedProcessDialog()
{
string caption = StringParser.Parse("${res:XML.MainMenu.DebugMenu.Stop}");
string message = StringParser.Parse("${res:MainWindow.Windows.Debug.StopProcessDialog.Message}");
string[] buttonLabels = new string[] { StringParser.Parse("${res:XML.MainMenu.DebugMenu.Detach}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Terminate}"), StringParser.Parse("${res:Global.CancelButtonText}") };
return (StopAttachedProcessDialogResult)MessageService.ShowCustomDialog(caption, message, (int)StopAttachedProcessDialogResult.Detach, (int)StopAttachedProcessDialogResult.Cancel, buttonLabels);
}
}
}

BIN
src/Main/StartUp/Project/Resources/StringResources.resources

Binary file not shown.
Loading…
Cancel
Save