Browse Source

Re-write debugger options to use accessors with Get/Set methods.

newNRvisualizers
David Srbecký 13 years ago
parent
commit
7966faa3cc
  1. 97
      src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs
  2. 2
      src/AddIns/Debugger/Debugger.Core/Module.cs
  3. 2
      src/AddIns/Debugger/Debugger.Core/NDebugger.cs
  4. 32
      src/AddIns/Debugger/Debugger.Core/Options.cs

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

@ -2,7 +2,9 @@ @@ -2,7 +2,9 @@
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.Xml.Serialization;
using Debugger;
@ -12,34 +14,91 @@ namespace ICSharpCode.SharpDevelop.Services @@ -12,34 +14,91 @@ namespace ICSharpCode.SharpDevelop.Services
{
public enum ShowIntegersAs { Decimal, Hexadecimal, Both };
[Serializable]
public class DebuggingOptions: Options
{
public static DebuggingOptions Instance {
get {
return PropertyService.Get("DebuggingOptions", new DebuggingOptions());
}
get { return new DebuggingOptions(); }
}
public DebuggingOptions()
{
ShowIntegersAs = ShowIntegersAs.Decimal;
DebuggerEventWindowState = FormWindowState.Normal;
DebuggeeExceptionWindowState = FormWindowState.Normal;
public IPropertyService PS {
get { return SD.GetService<IPropertyService>(); }
}
public override bool EnableJustMyCode {
get { return PS.Get<bool>("Debugger.EnableJustMyCode", true); }
set { PS.Set<bool>("Debugger.EnableJustMyCode", value); }
}
public ShowIntegersAs ShowIntegersAs { get; set; }
public bool ShowArgumentNames { get; set; }
public bool ShowArgumentValues { get; set; }
public bool ShowExternalMethods { get; set; }
public bool ShowLineNumbers { get; set; }
public bool ShowModuleNames { get; set; }
// This enables decompilation
public override bool StepOverNoSymbols {
get { return PS.Get<bool>("Debugger.StepOverNoSymbols", true); }
set { PS.Set<bool>("Debugger.StepOverNoSymbols", value); }
}
public override bool StepOverDebuggerAttributes {
get { return PS.Get<bool>("Debugger.StepOverDebuggerAttributes", true); }
set { PS.Set<bool>("Debugger.StepOverDebuggerAttributes", value); }
}
// Properties for the DebuggerExceptionForm
public FormWindowState DebuggerEventWindowState { get; set; }
public override bool StepOverAllProperties {
get { return PS.Get<bool>("Debugger.StepOverAllProperties", false); }
set { PS.Set<bool>("Debugger.StepOverAllProperties", value); }
}
// Properties for the DebuggeeExceptionForm
public FormWindowState DebuggeeExceptionWindowState { get; set; }
public override bool StepOverFieldAccessProperties {
get { return PS.Get<bool>("Debugger.StepOverFieldAccessProperties", true); }
set { PS.Set<bool>("Debugger.StepOverFieldAccessProperties", value); }
}
public override IEnumerable<string> SymbolsSearchPaths {
get { return PS.GetList<string>("Debugger.SymbolsSearchPaths"); }
set { PS.SetList<string>("Debugger.SymbolsSearchPaths", value); }
}
public override bool PauseOnHandledExceptions {
get { return PS.Get<bool>("Debugger.PauseOnHandledExceptions", false); }
set { PS.Set<bool>("Debugger.PauseOnHandledExceptions", value); }
}
public ShowIntegersAs ShowIntegersAs {
get { return PS.Get<ShowIntegersAs>("Debugger.ShowIntegersAs", ShowIntegersAs.Decimal); }
set { PS.Set<ShowIntegersAs>("Debugger.ShowIntegersAs", value); }
}
public bool ShowArgumentNames {
get { return PS.Get<bool>("Debugger.ShowArgumentNames", false); }
set { PS.Set<bool>("Debugger.ShowArgumentNames", value); }
}
public bool ShowArgumentValues {
get { return PS.Get<bool>("Debugger.ShowArgumentValues", false); }
set { PS.Set<bool>("Debugger.ShowArgumentValues", value); }
}
public bool ShowExternalMethods {
get { return PS.Get<bool>("Debugger.ShowExternalMethods", false); }
set { PS.Set<bool>("Debugger.ShowExternalMethods", value); }
}
public bool ShowLineNumbers {
get { return PS.Get<bool>("Debugger.ShowLineNumbers", false); }
set { PS.Set<bool>("Debugger.ShowLineNumbers", value); }
}
public bool ShowModuleNames {
get { return PS.Get<bool>("Debugger.ShowModuleNames", false); }
set { PS.Set<bool>("Debugger.ShowModuleNames", value); }
}
public FormWindowState DebuggerEventWindowState {
get { return PS.Get<FormWindowState>("Debugger.DebuggerEventWindowState", FormWindowState.Normal); }
set { PS.Set<FormWindowState>("Debugger.DebuggerEventWindowState", value); }
}
public FormWindowState DebuggeeExceptionWindowState {
get { return PS.Get<FormWindowState>("Debugger.DebuggeeExceptionWindowState", FormWindowState.Normal); }
set { PS.Set<FormWindowState>("Debugger.DebuggeeExceptionWindowState", value); }
}
/// <summary>
/// Used to update status of some debugger properties while debugger is running.

2
src/AddIns/Debugger/Debugger.Core/Module.cs

@ -204,7 +204,7 @@ namespace Debugger @@ -204,7 +204,7 @@ namespace Debugger
/// <summary>
/// Load symblos for on-disk module
/// </summary>
public void LoadSymbolsFromDisk(string[] symbolsSearchPaths)
public void LoadSymbolsFromDisk(IEnumerable<string> symbolsSearchPaths)
{
if (!IsDynamic && !IsInMemory) {
if (symReader == null) {

2
src/AddIns/Debugger/Debugger.Core/NDebugger.cs

@ -33,7 +33,7 @@ namespace Debugger @@ -33,7 +33,7 @@ namespace Debugger
string debuggeeVersion;
Options options = new Options();
Options options;
public MTA2STA MTA2STA {
get {

32
src/AddIns/Debugger/Debugger.Core/Options.cs

@ -1,29 +1,17 @@ @@ -1,29 +1,17 @@
using System;
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System.Collections.Generic;
namespace Debugger
{
[Serializable]
public class Options
public abstract class Options
{
public Options()
{
EnableJustMyCode = true;
StepOverNoSymbols = true;
StepOverDebuggerAttributes = true;
StepOverAllProperties = false;
StepOverFieldAccessProperties = true;
SymbolsSearchPaths = new string[0];
PauseOnHandledExceptions = false;
}
public bool EnableJustMyCode { get; set; }
public bool StepOverNoSymbols { get; set; } // Decompilation
public bool StepOverDebuggerAttributes { get; set; }
public bool StepOverAllProperties { get; set; }
public bool StepOverFieldAccessProperties { get; set; }
public string[] SymbolsSearchPaths { get; set; }
public bool PauseOnHandledExceptions { get; set; }
public abstract bool EnableJustMyCode { get; set; }
public abstract bool StepOverNoSymbols { get; set; }
public abstract bool StepOverDebuggerAttributes { get; set; }
public abstract bool StepOverAllProperties { get; set; }
public abstract bool StepOverFieldAccessProperties { get; set; }
public abstract IEnumerable<string> SymbolsSearchPaths { get; set; }
public abstract bool PauseOnHandledExceptions { get; set; }
}
}

Loading…
Cancel
Save