Browse Source

fix another side of SD-1846 - Changing debugger options during debug causes exception

pull/6/merge
Siegfried Pammer 14 years ago
parent
commit
3abf671f4d
  1. 21
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
  2. 14
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs
  3. 10
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs

21
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs

@ -41,5 +41,26 @@ namespace ICSharpCode.SharpDevelop.Services @@ -41,5 +41,26 @@ namespace ICSharpCode.SharpDevelop.Services
// Properties for the DebuggeeExceptionForm
public FormWindowState DebuggeeExceptionWindowState { get; set; }
/// <summary>
/// Used to update status of some debugger properties while debugger is running.
/// </summary>
internal static void ResetStatus(Action<Process> resetStatus)
{
Process proc = WindowsDebugger.CurrentProcess;
// debug session is running
if (proc != null) {
bool wasPausedNow = false;
// if it is not paused, break execution
if (!proc.IsPaused) {
proc.Break();
wasPausedNow = true;
}
resetStatus(proc);
// continue if it was not paused before
if (wasPausedNow)
proc.AsyncContinue();
}
}
}
}

14
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml.cs

@ -50,19 +50,7 @@ namespace Debugger.AddIn.Options @@ -50,19 +50,7 @@ namespace Debugger.AddIn.Options
public override bool SaveOptions()
{
bool result = base.SaveOptions();
Process proc = WindowsDebugger.CurrentProcess;
// debug session is running
if (proc != null) {
bool wasPausedNow = false;
// if it is not paused, break execution
if (!proc.IsPaused) {
proc.Break();
wasPausedNow = true;
}
proc.Debugger.ResetJustMyCodeStatus();
// continue if it was not paused before
if (wasPausedNow) proc.AsyncContinue();
}
DebuggingOptions.ResetStatus(proc => proc.Debugger.ResetJustMyCodeStatus());
return result;
}
}

10
src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingSymbolsPanel.cs

@ -30,11 +30,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -30,11 +30,11 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public override bool StorePanelContents()
{
DebuggingOptions.Instance.SymbolsSearchPaths = pathList.GetList();
Process proc = WindowsDebugger.CurrentProcess;
if (proc != null) {
proc.Debugger.ReloadModuleSymbols();
proc.Debugger.ResetJustMyCodeStatus();
}
DebuggingOptions.ResetStatus(
proc => {
proc.Debugger.ReloadModuleSymbols();
proc.Debugger.ResetJustMyCodeStatus();
});
return true;
}
}

Loading…
Cancel
Save