Browse Source

All debugging options are stored in a special purpose class which is then serialized into the SharpDevelop properties file.

Added ChainIndex and FrameIndex to the StackFrame class

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3222 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 17 years ago
parent
commit
bb1c30b9b6
  1. BIN
      data/resources/StringResources.es-mx.resources
  2. BIN
      data/resources/StringResources.es.resources
  3. BIN
      data/resources/StringResources.nl.resources
  4. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin
  5. 85
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs
  6. 154
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptionsPanel.Designer.cs
  7. 28
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptionsPanel.cs
  8. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingSymbolsPanel.Designer.cs
  9. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingSymbolsPanel.cs
  10. 12
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.Menu.cs
  11. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  12. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  13. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs
  14. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj
  15. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Module.cs
  16. 90
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.Options.cs
  17. 7
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs
  18. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs
  19. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs
  20. 38
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs
  21. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs
  22. 42
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Thread.cs
  23. 62
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Options.cs
  24. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/SourcecodeSegment.cs
  25. 9
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/Expression.cs
  26. 28
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs
  27. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs
  28. 2
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/MethodInfo.cs
  29. 18
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.cs
  30. 2
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggerAttributes.cs
  31. 24
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.cs
  32. 24
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs
  33. 10
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Metadata.cs
  34. 11
      src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/StackOverflow.cs
  35. 47
      src/Main/Core/Project/Src/Services/PropertyService/Properties.cs
  36. BIN
      src/Main/StartUp/Project/Resources/StringResources.resources

BIN
data/resources/StringResources.es-mx.resources

Binary file not shown.

BIN
data/resources/StringResources.es.resources

Binary file not shown.

BIN
data/resources/StringResources.nl.resources

Binary file not shown.

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Debugger.AddIn.addin

@ -86,10 +86,10 @@ @@ -86,10 +86,10 @@
label = "${res:Dialog.Options.IDEOptions.Debugging}"
insertbefore = "TextEditorOptions">
<DialogPanel id = "General"
label = "${res:Dialog.Options.IDEOptions.Debugging.PanelName}"
label = "${res:Dialog.Options.IDEOptions.Debugging.General}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.DebuggingOptionsPanel"/>
<DialogPanel id = "Symbols"
label = "${res:Dialog.Options.IDEOptions.DebuggingSymbols.PanelName}"
label = "${res:Dialog.Options.IDEOptions.Debugging.Symbols}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.DebuggingSymbolsPanel"/>
</DialogPanel>
</Path>

85
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs

@ -12,82 +12,43 @@ using ICSharpCode.SharpDevelop.Debugging; @@ -12,82 +12,43 @@ using ICSharpCode.SharpDevelop.Debugging;
namespace ICSharpCode.SharpDevelop.Services
{
public static class DebuggingOptions
public class DebuggingOptions: Debugger.Options
{
public static Properties DebuggingProperties {
public static DebuggingOptions Instance {
get {
return PropertyService.Get("Debugging", new Properties());
return PropertyService.Get("DebuggingOptions", new DebuggingOptions());
}
}
public static bool ICorDebugVisualizerEnabled {
get { return DebuggingProperties.Get("ICorDebugVisualizerEnabled", false); }
set { DebuggingProperties.Set("ICorDebugVisualizerEnabled", value); }
}
public static bool ShowValuesInHexadecimal {
get { return DebuggingProperties.Get("ShowValuesInHexadecimal", false); }
set { DebuggingProperties.Set("ShowValuesInHexadecimal", value); }
}
public static bool ShowArgumentNames {
get { return DebuggingProperties.Get("ShowArgumentNames", true); }
set { DebuggingProperties.Set("ShowArgumentNames", value); }
}
public static bool ShowArgumentValues {
get { return DebuggingProperties.Get("ShowArgumentValues", true); }
set { DebuggingProperties.Set("ShowArgumentValues", value); }
}
bool iCorDebugVisualizerEnabled;
bool showValuesInHexadecimal;
bool showArgumentNames;
bool showArgumentValues;
bool showExternalMethods;
public static bool ShowExternalMethods {
get { return DebuggingProperties.Get("ShowExternalMethods", false); }
set { DebuggingProperties.Set("ShowExternalMethods", value); }
public bool ICorDebugVisualizerEnabled {
get { return iCorDebugVisualizerEnabled; }
set { iCorDebugVisualizerEnabled = value; }
}
public static bool JustMyCodeEnabled {
get { return DebuggingProperties.Get("JustMyCodeEnabled", true); }
set { DebuggingProperties.Set("JustMyCodeEnabled", value); }
public bool ShowValuesInHexadecimal {
get { return showValuesInHexadecimal; }
set { showValuesInHexadecimal = value; }
}
public static bool ObeyDebuggerAttributes {
get { return DebuggingProperties.Get("ObeyDebuggerAttributes", true); }
set { DebuggingProperties.Set("ObeyDebuggerAttributes", value); }
public bool ShowArgumentNames {
get { return showArgumentNames; }
set { showArgumentNames = value; }
}
public static string[] SymbolsSearchPaths {
get { return DebuggingProperties.Get("SymbolsSearchPaths", new string[0]); }
set { DebuggingProperties.Set("SymbolsSearchPaths", value); }
public bool ShowArgumentValues {
get { return showArgumentValues; }
set { showArgumentValues = value; }
}
public static bool SkipProperties {
get { return DebuggingProperties.Get("SkipProperties", true); }
set { DebuggingProperties.Set("SkipProperties", value); }
}
public static bool SkipOnlySingleLineProperties {
get { return DebuggingProperties.Get("SkipOnlySingleLineProperties", true); }
set { DebuggingProperties.Set("SkipOnlySingleLineProperties", value); }
}
public static bool Verbose {
get { return DebuggingProperties.Get("Verbose", false); }
set { DebuggingProperties.Set("Verbose", value); }
}
public static void ApplyToCurrentDebugger()
{
WindowsDebugger winDbg = DebuggerService.CurrentDebugger as WindowsDebugger;
if (winDbg != null && winDbg.DebuggerCore != null) {
NDebugger debugger = winDbg.DebuggerCore;
debugger.JustMyCodeEnabled = JustMyCodeEnabled;
debugger.ObeyDebuggerAttributes = ObeyDebuggerAttributes;
debugger.SymbolsSearchPaths = SymbolsSearchPaths;
debugger.SkipProperties = SkipProperties;
debugger.SkipOnlySingleLineProperties = SkipOnlySingleLineProperties;
debugger.Verbose = Verbose;
}
public bool ShowExternalMethods {
get { return showExternalMethods; }
set { showExternalMethods = value; }
}
}
}

154
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptionsPanel.Designer.cs generated

@ -35,68 +35,116 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -35,68 +35,116 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
/// </summary>
private void InitializeComponent()
{
this.jmc = new System.Windows.Forms.CheckBox();
this.obeyDebuggerAttributes = new System.Windows.Forms.CheckBox();
this.skipProperties = new System.Windows.Forms.CheckBox();
this.skipOnlySingleLineProperties = new System.Windows.Forms.CheckBox();
this.groupBoxStepping = new System.Windows.Forms.GroupBox();
this.stepOverFieldAccessProperties = new System.Windows.Forms.CheckBox();
this.stepOverSingleLineProperties = new System.Windows.Forms.CheckBox();
this.stepOverAllProperties = new System.Windows.Forms.CheckBox();
this.stepOverDebuggerAttributes = new System.Windows.Forms.CheckBox();
this.stepOverNoSymbols = new System.Windows.Forms.CheckBox();
this.enableJustMyCode = new System.Windows.Forms.CheckBox();
this.groupBoxStepping.SuspendLayout();
this.SuspendLayout();
//
// jmc
//
this.jmc.AutoSize = true;
this.jmc.Location = new System.Drawing.Point(13, 15);
this.jmc.Name = "jmc";
this.jmc.Size = new System.Drawing.Size(491, 24);
this.jmc.TabIndex = 0;
this.jmc.Text = "${res:Dialog.Options.IDEOptions.Debugging.EnableJustMyCode}";
this.jmc.UseVisualStyleBackColor = true;
//
// obeyDebuggerAttributes
//
this.obeyDebuggerAttributes.AutoSize = true;
this.obeyDebuggerAttributes.Location = new System.Drawing.Point(37, 45);
this.obeyDebuggerAttributes.Name = "obeyDebuggerAttributes";
this.obeyDebuggerAttributes.Size = new System.Drawing.Size(530, 24);
this.obeyDebuggerAttributes.TabIndex = 1;
this.obeyDebuggerAttributes.Text = "${res:Dialog.Options.IDEOptions.Debugging.ObeyDebuggerAttributes}";
this.obeyDebuggerAttributes.UseVisualStyleBackColor = true;
//
// skipProperties
//
this.skipProperties.AutoSize = true;
this.skipProperties.Location = new System.Drawing.Point(37, 75);
this.skipProperties.Name = "skipProperties";
this.skipProperties.Size = new System.Drawing.Size(456, 24);
this.skipProperties.TabIndex = 2;
this.skipProperties.Text = "${res:Dialog.Options.IDEOptions.Debugging.SkipProperties}";
this.skipProperties.UseVisualStyleBackColor = true;
//
// skipOnlySingleLineProperties
//
this.skipOnlySingleLineProperties.AutoSize = true;
this.skipOnlySingleLineProperties.Location = new System.Drawing.Point(65, 105);
this.skipOnlySingleLineProperties.Name = "skipOnlySingleLineProperties";
this.skipOnlySingleLineProperties.Size = new System.Drawing.Size(561, 24);
this.skipOnlySingleLineProperties.TabIndex = 3;
this.skipOnlySingleLineProperties.Text = "${res:Dialog.Options.IDEOptions.Debugging.SkipOnlySingleLineProperties}";
this.skipOnlySingleLineProperties.UseVisualStyleBackColor = true;
// groupBoxStepping
//
this.groupBoxStepping.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxStepping.Controls.Add(this.stepOverFieldAccessProperties);
this.groupBoxStepping.Controls.Add(this.stepOverSingleLineProperties);
this.groupBoxStepping.Controls.Add(this.stepOverAllProperties);
this.groupBoxStepping.Controls.Add(this.stepOverDebuggerAttributes);
this.groupBoxStepping.Controls.Add(this.stepOverNoSymbols);
this.groupBoxStepping.Controls.Add(this.enableJustMyCode);
this.groupBoxStepping.Location = new System.Drawing.Point(5, 9);
this.groupBoxStepping.Name = "groupBoxStepping";
this.groupBoxStepping.Size = new System.Drawing.Size(680, 204);
this.groupBoxStepping.TabIndex = 0;
this.groupBoxStepping.TabStop = false;
this.groupBoxStepping.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping}";
//
// stepOverFieldAccessProperties
//
this.stepOverFieldAccessProperties.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stepOverFieldAccessProperties.Location = new System.Drawing.Point(6, 175);
this.stepOverFieldAccessProperties.Name = "stepOverFieldAccessProperties";
this.stepOverFieldAccessProperties.Size = new System.Drawing.Size(668, 24);
this.stepOverFieldAccessProperties.TabIndex = 0;
this.stepOverFieldAccessProperties.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.StepOverFieldAccessProperties}" +
"";
this.stepOverFieldAccessProperties.UseVisualStyleBackColor = true;
//
// stepOverSingleLineProperties
//
this.stepOverSingleLineProperties.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stepOverSingleLineProperties.Location = new System.Drawing.Point(6, 145);
this.stepOverSingleLineProperties.Name = "stepOverSingleLineProperties";
this.stepOverSingleLineProperties.Size = new System.Drawing.Size(668, 24);
this.stepOverSingleLineProperties.TabIndex = 0;
this.stepOverSingleLineProperties.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties}";
this.stepOverSingleLineProperties.UseVisualStyleBackColor = true;
//
// stepOverAllProperties
//
this.stepOverAllProperties.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stepOverAllProperties.Location = new System.Drawing.Point(6, 115);
this.stepOverAllProperties.Name = "stepOverAllProperties";
this.stepOverAllProperties.Size = new System.Drawing.Size(668, 24);
this.stepOverAllProperties.TabIndex = 0;
this.stepOverAllProperties.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.StepOverAllProperties}";
this.stepOverAllProperties.UseVisualStyleBackColor = true;
//
// stepOverDebuggerAttributes
//
this.stepOverDebuggerAttributes.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stepOverDebuggerAttributes.Location = new System.Drawing.Point(6, 85);
this.stepOverDebuggerAttributes.Name = "stepOverDebuggerAttributes";
this.stepOverDebuggerAttributes.Size = new System.Drawing.Size(668, 24);
this.stepOverDebuggerAttributes.TabIndex = 0;
this.stepOverDebuggerAttributes.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.StepOverDebuggerAttributes}";
this.stepOverDebuggerAttributes.UseVisualStyleBackColor = true;
//
// stepOverNoSymbols
//
this.stepOverNoSymbols.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.stepOverNoSymbols.Location = new System.Drawing.Point(6, 55);
this.stepOverNoSymbols.Name = "stepOverNoSymbols";
this.stepOverNoSymbols.Size = new System.Drawing.Size(668, 24);
this.stepOverNoSymbols.TabIndex = 0;
this.stepOverNoSymbols.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.StepOverNoSymbols}";
this.stepOverNoSymbols.UseVisualStyleBackColor = true;
//
// enableJustMyCode
//
this.enableJustMyCode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.enableJustMyCode.Location = new System.Drawing.Point(6, 25);
this.enableJustMyCode.Name = "enableJustMyCode";
this.enableJustMyCode.Size = new System.Drawing.Size(668, 24);
this.enableJustMyCode.TabIndex = 0;
this.enableJustMyCode.Text = "${res:Dialog.Options.IDEOptions.Debugging.Stepping.EnableJustMyCode}";
this.enableJustMyCode.UseVisualStyleBackColor = true;
//
// DebuggingOptionsPanel
//
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.skipOnlySingleLineProperties);
this.Controls.Add(this.skipProperties);
this.Controls.Add(this.obeyDebuggerAttributes);
this.Controls.Add(this.jmc);
this.Controls.Add(this.groupBoxStepping);
this.Name = "DebuggingOptionsPanel";
this.Size = new System.Drawing.Size(626, 300);
this.Size = new System.Drawing.Size(688, 300);
this.groupBoxStepping.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.CheckBox skipOnlySingleLineProperties;
private System.Windows.Forms.CheckBox skipProperties;
private System.Windows.Forms.CheckBox obeyDebuggerAttributes;
private System.Windows.Forms.CheckBox jmc;
private System.Windows.Forms.CheckBox enableJustMyCode;
private System.Windows.Forms.CheckBox stepOverNoSymbols;
private System.Windows.Forms.CheckBox stepOverDebuggerAttributes;
private System.Windows.Forms.CheckBox stepOverAllProperties;
private System.Windows.Forms.CheckBox stepOverSingleLineProperties;
private System.Windows.Forms.CheckBox stepOverFieldAccessProperties;
private System.Windows.Forms.GroupBox groupBoxStepping;
}
}

28
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptionsPanel.cs

@ -26,24 +26,34 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -26,24 +26,34 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
foreach (Control ctl in Controls.GetRecursive()) {
ctl.Text = StringParser.Parse(ctl.Text);
}
stepOverAllProperties.CheckedChanged += delegate {
stepOverSingleLineProperties.Enabled = !stepOverAllProperties.Checked;
stepOverFieldAccessProperties.Enabled = !stepOverAllProperties.Checked;
};
}
public override void LoadPanelContents()
{
jmc.Checked = DebuggingOptions.JustMyCodeEnabled;
obeyDebuggerAttributes.Checked = DebuggingOptions.ObeyDebuggerAttributes;
skipProperties.Checked = DebuggingOptions.SkipProperties;
skipOnlySingleLineProperties.Checked = DebuggingOptions.SkipOnlySingleLineProperties;
DebuggingOptions opt = DebuggingOptions.Instance;
enableJustMyCode.Checked = opt.EnableJustMyCode;
stepOverNoSymbols.Checked = opt.StepOverNoSymbols;
stepOverDebuggerAttributes.Checked = opt.StepOverDebuggerAttributes;
stepOverAllProperties.Checked = opt.StepOverAllProperties;
stepOverSingleLineProperties.Checked = opt.StepOverSingleLineProperties;
stepOverFieldAccessProperties.Checked = opt.StepOverFieldAccessProperties;
}
public override bool StorePanelContents()
{
DebuggingOptions.JustMyCodeEnabled = jmc.Checked;
DebuggingOptions.ObeyDebuggerAttributes = obeyDebuggerAttributes.Checked;
DebuggingOptions.SkipProperties = skipProperties.Checked;
DebuggingOptions.SkipOnlySingleLineProperties = skipOnlySingleLineProperties.Checked;
DebuggingOptions opt = DebuggingOptions.Instance;
DebuggingOptions.ApplyToCurrentDebugger();
opt.EnableJustMyCode = enableJustMyCode.Checked;
opt.StepOverNoSymbols = stepOverNoSymbols.Checked;
opt.StepOverDebuggerAttributes = stepOverDebuggerAttributes.Checked;
opt.StepOverAllProperties = stepOverAllProperties.Checked;
opt.StepOverSingleLineProperties = stepOverSingleLineProperties.Checked;
opt.StepOverFieldAccessProperties = stepOverFieldAccessProperties.Checked;
return true;
}

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingSymbolsPanel.Designer.cs generated

@ -46,7 +46,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -46,7 +46,7 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
| System.Windows.Forms.AnchorStyles.Right)));
this.pathList.AutoAddAfterBrowse = true;
this.pathList.BrowseForDirectory = true;
this.pathList.ListCaption = "${res:Dialog.Options.IDEOptions.DebuggingSymbols.ListCaption}";
this.pathList.ListCaption = "${res:Dialog.Options.IDEOptions.Debugging.Symbols.ListCaption}";
this.pathList.Location = new System.Drawing.Point(0, 0);
this.pathList.ManualOrder = true;
this.pathList.Name = "pathList";

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingSymbolsPanel.cs

@ -31,14 +31,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels @@ -31,14 +31,12 @@ namespace ICSharpCode.SharpDevelop.Gui.OptionPanels
public override void LoadPanelContents()
{
pathList.LoadList(DebuggingOptions.SymbolsSearchPaths);
pathList.LoadList(DebuggingOptions.Instance.SymbolsSearchPaths);
}
public override bool StorePanelContents()
{
DebuggingOptions.SymbolsSearchPaths = pathList.GetList();
DebuggingOptions.ApplyToCurrentDebugger();
DebuggingOptions.Instance.SymbolsSearchPaths = pathList.GetList();
return true;
}

12
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.Menu.cs

@ -63,27 +63,27 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -63,27 +63,27 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
ToolStripMenuItem argNamesItem;
argNamesItem = new ToolStripMenuItem();
argNamesItem.Text = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ShowArgumentNames");
argNamesItem.Checked = DebuggingOptions.ShowArgumentNames;
argNamesItem.Checked = DebuggingOptions.Instance.ShowArgumentNames;
argNamesItem.Click += delegate {
DebuggingOptions.ShowArgumentNames = !DebuggingOptions.ShowArgumentNames;
DebuggingOptions.Instance.ShowArgumentNames = !DebuggingOptions.Instance.ShowArgumentNames;
RefreshPad();
};
ToolStripMenuItem argValuesItem;
argValuesItem = new ToolStripMenuItem();
argValuesItem.Text = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ShowArgumentValues");
argValuesItem.Checked = DebuggingOptions.ShowArgumentValues;
argValuesItem.Checked = DebuggingOptions.Instance.ShowArgumentValues;
argValuesItem.Click += delegate {
DebuggingOptions.ShowArgumentValues = !DebuggingOptions.ShowArgumentValues;
DebuggingOptions.Instance.ShowArgumentValues = !DebuggingOptions.Instance.ShowArgumentValues;
RefreshPad();
};
ToolStripMenuItem extMethodsItem;
extMethodsItem = new ToolStripMenuItem();
extMethodsItem.Text = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ShowExternalMethods");
extMethodsItem.Checked = DebuggingOptions.ShowExternalMethods;
extMethodsItem.Checked = DebuggingOptions.Instance.ShowExternalMethods;
extMethodsItem.Click += delegate {
DebuggingOptions.ShowExternalMethods = !DebuggingOptions.ShowExternalMethods;
DebuggingOptions.Instance.ShowExternalMethods = !DebuggingOptions.Instance.ShowExternalMethods;
RefreshPad();
};

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
public List<ListViewItem> CreateItems()
{
bool showExternalMethods = DebuggingOptions.ShowExternalMethods;
bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods;
bool lastItemIsExternalMethod = false;
List<ListViewItem> items = new List<ListViewItem>();
@ -200,8 +200,8 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -200,8 +200,8 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
public string GetFullName(StackFrame frame)
{
bool showArgumentNames = DebuggingOptions.ShowArgumentNames;
bool showArgumentValues = DebuggingOptions.ShowArgumentValues;
bool showArgumentNames = DebuggingOptions.Instance.ShowArgumentNames;
bool showArgumentValues = DebuggingOptions.Instance.ShowArgumentValues;
StringBuilder name = new StringBuilder();
name.Append(frame.MethodInfo.Name);

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

@ -419,7 +419,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -419,7 +419,7 @@ namespace ICSharpCode.SharpDevelop.Services
debugger = new NDebugger();
DebuggingOptions.ApplyToCurrentDebugger();
debugger.Options = DebuggingOptions.Instance;
debugger.DebuggerTraceMessage += debugger_TraceMessage;
debugger.ProcessStarted += debugger_ProcessStarted;

8
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/ValueNode.cs

@ -73,7 +73,7 @@ namespace Debugger.AddIn.TreeModel @@ -73,7 +73,7 @@ namespace Debugger.AddIn.TreeModel
this.Name = val.Expression.CodeTail;
if (DebuggingOptions.ShowValuesInHexadecimal && val.Type.IsInteger) {
if (DebuggingOptions.Instance.ShowValuesInHexadecimal && val.Type.IsInteger) {
this.Text = String.Format("0x{0:X}", val.PrimitiveValue);
} else {
this.Text = val.AsString;
@ -94,7 +94,7 @@ namespace Debugger.AddIn.TreeModel @@ -94,7 +94,7 @@ namespace Debugger.AddIn.TreeModel
this.ChildNodes = null;
}
if (DebuggingOptions.ICorDebugVisualizerEnabled) {
if (DebuggingOptions.Instance.ICorDebugVisualizerEnabled) {
AbstractNode info = ICorDebug.GetDebugInfoRoot(val.Process, val.CorValue);
this.ChildNodes = PrependNode(info, this.ChildNodes);
}
@ -204,9 +204,9 @@ namespace Debugger.AddIn.TreeModel @@ -204,9 +204,9 @@ namespace Debugger.AddIn.TreeModel
ToolStripMenuItem hexView;
hexView = new ToolStripMenuItem();
hexView.Text = ResourceService.GetString("MainWindow.Windows.Debug.LocalVariables.ShowInHexadecimal");
hexView.Checked = DebuggingOptions.ShowValuesInHexadecimal;
hexView.Checked = DebuggingOptions.Instance.ShowValuesInHexadecimal;
hexView.Click += delegate {
DebuggingOptions.ShowValuesInHexadecimal = !DebuggingOptions.ShowValuesInHexadecimal;
DebuggingOptions.Instance.ShowValuesInHexadecimal = !DebuggingOptions.Instance.ShowValuesInHexadecimal;
};
menu.Items.AddRange(new ToolStripItem[] {

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Debugger.Core.csproj

@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
<Compile Include="Src\Control\NDebugger-Breakpoints.cs" />
<Compile Include="Src\Control\NDebugger-Processes.cs" />
<Compile Include="Src\Control\NDebugger.cs" />
<Compile Include="Src\Control\NDebugger.Options.cs" />
<Compile Include="Src\Control\Process-Evals.cs" />
<Compile Include="Src\Control\Process-Modules.cs" />
<Compile Include="Src\Control\Process-StateControl.cs" />
@ -60,6 +59,7 @@ @@ -60,6 +59,7 @@
<Compile Include="Src\Debugger\DebuggerObject.cs" />
<Compile Include="Src\Debugger\Exception.cs" />
<Compile Include="Src\Debugger\ExceptionType.cs" />
<Compile Include="Src\Debugger\Options.cs" />
<Compile Include="Src\Debugger\PausedReason.cs" />
<Compile Include="Src\Debugger\PauseSession.cs" />
<Compile Include="Src\Debugger\SourcecodeSegment.cs" />

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Module.cs

@ -175,7 +175,7 @@ namespace Debugger @@ -175,7 +175,7 @@ namespace Debugger
fullPath = pModule.Name;
LoadSymbols(process.Debugger.SymbolsSearchPaths);
LoadSymbols(process.Options.SymbolsSearchPaths);
SetJustMyCodeStatus();
}
@ -198,7 +198,7 @@ namespace Debugger @@ -198,7 +198,7 @@ namespace Debugger
DateTime start, end;
uint unused = 0;
if (!this.Debugger.JustMyCodeEnabled) {
if (!this.Process.Options.EnableJustMyCode) {
corModule.CastTo<ICorDebugModule2>().SetJMCStatus(1, 0, ref unused);
return;
}
@ -217,7 +217,7 @@ namespace Debugger @@ -217,7 +217,7 @@ namespace Debugger
start = Util.HighPrecisionTimer.Now;
// Apply non-user code attributes
if (this.Debugger.ObeyDebuggerAttributes) {
if (this.Process.Options.StepOverDebuggerAttributes) {
foreach(CustomAttributeProps ca in metaData.EnumCustomAttributeProps(0, 0)) {
MemberRefProps constructorMethod = metaData.GetMemberRefProps(ca.Type);
TypeRefProps attributeType = metaData.GetTypeRefProps(constructorMethod.DeclaringType);
@ -228,7 +228,7 @@ namespace Debugger @@ -228,7 +228,7 @@ namespace Debugger
if (ca.Owner >> 24 == 0x02) { // TypeDef
ICorDebugClass2 corClass = corModule.GetClassFromToken(ca.Owner).CastTo<ICorDebugClass2>();
corClass.SetJMCStatus(0 /* false */);
if (this.Debugger.Verbose) {
if (this.Process.Options.Verbose) {
this.Process.TraceMessage("Class {0} marked as non-user code", metaData.GetTypeDefProps(ca.Owner).Name);
}
}
@ -243,7 +243,7 @@ namespace Debugger @@ -243,7 +243,7 @@ namespace Debugger
start = Util.HighPrecisionTimer.Now;
// Mark all methods without symbols as non-user code
if (this.Debugger.ObeyDebuggerAttributes) { // TODO: Remove
if (this.Process.Options.StepOverDebuggerAttributes) { // TODO: Remove
foreach(uint typeDef in metaData.EnumTypeDefs()) {
foreach(uint methodDef in metaData.EnumMethods(typeDef)) {
if (!HasMethodSymbols(methodDef)) {
@ -257,16 +257,16 @@ namespace Debugger @@ -257,16 +257,16 @@ namespace Debugger
start = Util.HighPrecisionTimer.Now;
// Skip properties
if (this.Debugger.SkipProperties) {
if (this.Process.Options.StepOverAllProperties) {
foreach(uint typeDef in metaData.EnumTypeDefs()) {
foreach(PropertyProps prop in metaData.EnumPropertyProps(typeDef)) {
if ((prop.GetterMethod & 0xFFFFFF) != 0) {
if (!Debugger.SkipOnlySingleLineProperties || IsSingleLine(prop.GetterMethod)) {
if (!Process.Options.StepOverSingleLineProperties || IsSingleLine(prop.GetterMethod)) {
DisableJustMyCode(prop.GetterMethod);
}
}
if ((prop.SetterMethod & 0xFFFFFF) != 0) {
if (!Debugger.SkipOnlySingleLineProperties || IsSingleLine(prop.SetterMethod)) {
if (!Process.Options.StepOverSingleLineProperties || IsSingleLine(prop.SetterMethod)) {
DisableJustMyCode(prop.SetterMethod);
}
}
@ -296,7 +296,7 @@ namespace Debugger @@ -296,7 +296,7 @@ namespace Debugger
ICorDebugFunction2 corFunction = corModule.GetFunctionFromToken(methodProps.Token).CastTo<ICorDebugFunction2>();
corFunction.SetJMCStatus(0 /* false */);
if (this.Debugger.Verbose) {
if (this.Process.Options.Verbose) {
this.Process.TraceMessage("Funciton {0}.{1} marked as non-user code", typeProps.Name, methodProps.Name);
}
}

90
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.Options.cs

@ -1,90 +0,0 @@ @@ -1,90 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger
{
public partial class NDebugger
{
bool justMyCodeEnabled = true;
bool obeyDebuggerAttributes = true;
bool skipProperties = true;
bool skipOnlySingleLineProperties = true;
bool verbose = false;
string[] symbolsSearchPaths;
void ResetJustMyCodeInModules()
{
foreach(Process process in this.Processes) {
foreach(Module module in process.Modules) {
module.SetJustMyCodeStatus();
}
}
}
public bool JustMyCodeEnabled {
get { return justMyCodeEnabled; }
set {
if (justMyCodeEnabled != value) {
justMyCodeEnabled = value;
ResetJustMyCodeInModules();
}
}
}
public bool ObeyDebuggerAttributes {
get { return obeyDebuggerAttributes; }
set {
if (obeyDebuggerAttributes != value) {
obeyDebuggerAttributes = value;
ResetJustMyCodeInModules();
}
}
}
public bool SkipProperties {
get { return skipProperties; }
set {
if (skipProperties != value) {
skipProperties = value;
ResetJustMyCodeInModules();
}
}
}
public bool SkipOnlySingleLineProperties {
get { return skipOnlySingleLineProperties; }
set {
if (skipOnlySingleLineProperties != value) {
skipOnlySingleLineProperties = value;
ResetJustMyCodeInModules();
}
}
}
public string[] SymbolsSearchPaths {
get { return symbolsSearchPaths; }
set {
if (symbolsSearchPaths != value) {
symbolsSearchPaths = value;
foreach(Process process in this.Processes) {
foreach(Module module in process.Modules) {
// Try to load the symbols
module.LoadSymbols(symbolsSearchPaths);
}
}
}
}
}
public bool Verbose {
get { return verbose; }
set { verbose = value; }
}
}
}

7
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/NDebugger.cs

@ -26,6 +26,8 @@ namespace Debugger @@ -26,6 +26,8 @@ namespace Debugger
string debuggeeVersion;
Options options = new Options();
public MTA2STA MTA2STA {
get {
return mta2sta;
@ -44,6 +46,11 @@ namespace Debugger @@ -44,6 +46,11 @@ namespace Debugger
}
}
public Options Options {
get { return options; }
set { options = value; }
}
public NDebugger()
{
if (ApartmentState.STA == System.Threading.Thread.CurrentThread.GetApartmentState()) {

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process-StateControl.cs

@ -209,7 +209,7 @@ namespace Debugger @@ -209,7 +209,7 @@ namespace Debugger
NotifyResumed(action);
corProcess.Continue(0);
if (this.Debugger.Verbose) {
if (this.Options.Verbose) {
this.TraceMessage("Continue");
}

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Process.cs

@ -54,6 +54,12 @@ namespace Debugger @@ -54,6 +54,12 @@ namespace Debugger
}
}
public Options Options {
get {
return debugger.Options;
}
}
internal ManagedCallback CallbackInterface {
get {
return callbackInterface;

38
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/StackFrame.cs

@ -31,7 +31,8 @@ namespace Debugger @@ -31,7 +31,8 @@ namespace Debugger
ICorDebugFunction corFunction;
MethodInfo methodInfo;
int depth;
uint chainIndex;
uint frameIndex;
/// <summary> The process in which this stack frame is executed </summary>
[Debugger.Tests.Ignore]
@ -54,14 +55,17 @@ namespace Debugger @@ -54,14 +55,17 @@ namespace Debugger
}
}
/// <summary>
/// The depth of this frame. Most recent stack frame has depth 0.
/// The frame that called it has depth 1 and so on.
/// </summary>
public int Depth {
get { return depth; }
/// <summary> Internal index of the stack chain. The value is increasing with age. </summary>
public uint ChainIndex {
get { return chainIndex; }
}
/// <summary> Internal index of the stack frame. The value is increasing with age. </summary>
public uint FrameIndex {
get { return frameIndex; }
}
/// <summary> True if the stack frame has symbols defined.
/// (That is has accesss to the .pdb file) </summary>
public bool HasSymbols {
@ -78,14 +82,15 @@ namespace Debugger @@ -78,14 +82,15 @@ namespace Debugger
}
}
internal StackFrame(Thread thread, ICorDebugILFrame corILFrame, int depth)
internal StackFrame(Thread thread, ICorDebugILFrame corILFrame, uint chainIndex, uint frameIndex)
{
this.process = thread.Process;
this.thread = thread;
this.corILFrame = corILFrame;
this.corILFramePauseSession = process.PauseSession;
this.corFunction = corILFrame.Function;
this.depth = depth;
this.chainIndex = chainIndex;
this.frameIndex = frameIndex;
DebugType debugType = DebugType.Create(
this.Process,
@ -116,6 +121,13 @@ namespace Debugger @@ -116,6 +121,13 @@ namespace Debugger
}
}
internal StackFrame Reobtain()
{
StackFrame stackFrame = this.Thread.GetStackFrameAt(chainIndex, frameIndex);
if (stackFrame.MethodInfo != this.MethodInfo) throw new DebuggerException("The stack frame on the thread does not represent the same method anymore");
return stackFrame;
}
SourcecodeSegment GetSegmentForOffet(uint offset)
{
return SourcecodeSegment.Resolve(this.MethodInfo.Module, corFunction, offset);
@ -158,6 +170,7 @@ namespace Debugger @@ -158,6 +170,7 @@ namespace Debugger
public void AsyncStepOut()
{
new Stepper(this, "StackFrame step out").StepOut();
process.AsyncContinue(DebuggeeStateAction.Clear);
}
@ -167,18 +180,13 @@ namespace Debugger @@ -167,18 +180,13 @@ namespace Debugger
throw new DebuggerException("Unable to step. No symbols loaded.");
}
SourcecodeSegment nextSt;
nextSt = NextStatement;
SourcecodeSegment nextSt = NextStatement;
if (nextSt == null) {
throw new DebuggerException("Unable to step. Next statement not aviable");
}
if (stepIn) {
new Stepper(this, "StackFrame step in").StepIn(nextSt.StepRanges);
// Without JMC step in which ends in code without symblols is cotinued.
// The next step over ensures that we at least do step over.
new Stepper(this, "Safety step over").StepOver(nextSt.StepRanges);
} else {
new Stepper(this, "StackFrame step over").StepOver(nextSt.StepRanges);
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Stepper.cs

@ -80,7 +80,7 @@ namespace Debugger @@ -80,7 +80,7 @@ namespace Debugger
corStepper = stackFrame.CorILFrame.CreateStepper();
this.JustMyCode = Process.Debugger.JustMyCodeEnabled;
this.JustMyCode = Process.Options.EnableJustMyCode;
stackFrame.Thread.Steppers.Add(this);
}

42
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Control/Thread.cs

@ -281,25 +281,45 @@ namespace Debugger @@ -281,25 +281,45 @@ namespace Debugger
yield break;
}
int depth = 0;
foreach(ICorDebugChain corChain in CorThread.EnumerateChains().Enumerator) {
if (corChain.IsManaged == 0) continue; // Only managed ones
foreach(ICorDebugFrame corFrame in corChain.EnumerateFrames().Enumerator) {
if (corFrame.Is<ICorDebugILFrame>()) {
StackFrame stackFrame;
try {
stackFrame = new StackFrame(this, corFrame.CastTo<ICorDebugILFrame>(), depth);
depth++;
} catch (COMException) { // TODO
continue;
};
yield return stackFrame;
}
if (!corFrame.Is<ICorDebugILFrame>()) continue; // Only IL frames
StackFrame stackFrame;
try {
stackFrame = new StackFrame(this, corFrame.CastTo<ICorDebugILFrame>(), corChain.Index, corFrame.Index);
} catch (COMException) { // TODO
continue;
};
yield return stackFrame;
}
}
}
}
internal StackFrame GetStackFrameAt(uint chainIndex, uint frameIndex)
{
process.AssertPaused();
ICorDebugChainEnum corChainEnum = CorThread.EnumerateChains();
if (chainIndex >= corChainEnum.Count) throw new DebuggerException("The requested chain index is too big");
corChainEnum.Skip(corChainEnum.Count - chainIndex - 1);
ICorDebugChain corChain = corChainEnum.Next();
if (corChain.IsManaged == 0) throw new DebuggerException("The requested chain is not managed");
ICorDebugFrameEnum corFrameEnum = corChain.EnumerateFrames();
if (frameIndex >= corFrameEnum.Count) throw new DebuggerException("The requested frame index is too big");
corFrameEnum.Skip(corFrameEnum.Count - frameIndex - 1);
ICorDebugFrame corFrame = corFrameEnum.Next();
if (!corFrame.Is<ICorDebugILFrame>()) throw new DebuggerException("The rquested frame is not IL frame");
StackFrame stackFrame = new StackFrame(this, corFrame.CastTo<ICorDebugILFrame>(), chainIndex, frameIndex);
return stackFrame;
}
public string GetStackTrace()
{
return GetStackTrace("at {0} in {1}:line {2}", "at {0}");

62
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Options.cs

@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
// <version>$Revision$</version>
// </file>
using System;
namespace Debugger
{
public class Options
{
bool enableJustMyCode = true;
bool stepOverNoSymbols = true;
bool stepOverDebuggerAttributes = true;
bool stepOverAllProperties = false;
bool stepOverSingleLineProperties = false;
bool stepOverFieldAccessProperties = true;
bool verbose = false;
string[] symbolsSearchPaths = new string[0];
public bool EnableJustMyCode {
get { return enableJustMyCode; }
set { enableJustMyCode = value; }
}
public bool StepOverNoSymbols {
get { return stepOverNoSymbols; }
set { stepOverNoSymbols = value; }
}
public bool StepOverDebuggerAttributes {
get { return stepOverDebuggerAttributes; }
set { stepOverDebuggerAttributes = value; }
}
public bool StepOverAllProperties {
get { return stepOverAllProperties; }
set { stepOverAllProperties = value; }
}
public bool StepOverSingleLineProperties {
get { return stepOverSingleLineProperties; }
set { stepOverSingleLineProperties = value; }
}
public bool StepOverFieldAccessProperties {
get { return stepOverFieldAccessProperties; }
set { stepOverFieldAccessProperties = value; }
}
public bool Verbose {
get { return verbose; }
set { verbose = value; }
}
public string[] SymbolsSearchPaths {
get { return symbolsSearchPaths; }
set { symbolsSearchPaths = value; }
}
}
}

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/SourcecodeSegment.cs

@ -185,7 +185,7 @@ namespace Debugger @@ -185,7 +185,7 @@ namespace Debugger
List<string> searchPaths = new List<string>();
searchPaths.AddRange(module.Process.Debugger.SymbolsSearchPaths);
searchPaths.AddRange(module.Process.Options.SymbolsSearchPaths);
string modulePath = module.FullPath;
while (true) {

9
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Expressions/Expression.cs

@ -19,7 +19,6 @@ namespace Debugger.Expressions @@ -19,7 +19,6 @@ namespace Debugger.Expressions
static Dictionary<Expression, Value> expressionCache;
static DebuggeeState expressionCache_debuggerState;
static Thread expressionCache_thread;
static int expressionCache_stackDepth;
public abstract string Code {
get;
@ -45,13 +44,11 @@ namespace Debugger.Expressions @@ -45,13 +44,11 @@ namespace Debugger.Expressions
{
if (expressionCache == null ||
expressionCache_debuggerState != context.Process.DebuggeeState ||
expressionCache_thread != context.Thread ||
expressionCache_stackDepth != context.Depth)
expressionCache_thread != context.Thread)
{
expressionCache = new Dictionary<Expression, Value>();
expressionCache_debuggerState = context.Process.DebuggeeState;
expressionCache_thread = context.Thread;
expressionCache_stackDepth = context.Depth;
context.Process.TraceMessage("Expression cache cleared");
}
if (expressionCache.ContainsKey(this)) {
@ -72,7 +69,7 @@ namespace Debugger.Expressions @@ -72,7 +69,7 @@ namespace Debugger.Expressions
result = GetFromCache(context);
if (result != null) {
if (context.Process.Debugger.Verbose) {
if (context.Process.Options.Verbose) {
context.Process.TraceMessage(string.Format("Cached: {0,-12} ({1})", this.Code, this.GetType().Name));
}
return result;
@ -90,7 +87,7 @@ namespace Debugger.Expressions @@ -90,7 +87,7 @@ namespace Debugger.Expressions
DateTime end = Debugger.Util.HighPrecisionTimer.Now;
expressionCache[this] = result;
if (context.Process.Debugger.Verbose) {
if (context.Process.Options.Verbose) {
context.Process.TraceMessage(string.Format("Evaluated: {0,-12} ({1}) ({2} ms)", this.Code, this.GetType().Name, (end - start).TotalMilliseconds));
}
return result;

28
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Internal/ManagedCallback.cs

@ -92,7 +92,7 @@ namespace Debugger @@ -92,7 +92,7 @@ namespace Debugger
if (!pauseOnNextExit || process.Evaluating || hasQueuedCallbacks) {
process.AsyncContinue(DebuggeeStateAction.Keep);
} else {
if (process.Debugger.Verbose) {
if (process.Options.Verbose) {
process.TraceMessage("Callback exit: Paused");
}
pauseOnNextExit = false;
@ -131,27 +131,13 @@ namespace Debugger @@ -131,27 +131,13 @@ namespace Debugger
stepper.OnStepComplete();
if (stepper.PauseWhenComplete) {
if (process.SelectedThread.MostRecentStackFrame.HasSymbols) {
// JMC is ignored by the API during StepOut - Compensate
if (process.Debugger.JustMyCodeEnabled &&
stepper.Operation == Stepper.StepperOperation.StepOut &&
!process.SelectedThread.MostRecentStackFrame.MethodInfo.IsMyCode) {
process.TraceMessage(" - stepping out non-user code at " + process.SelectedThread.MostRecentStackFrame.ToString());
new Stepper(process.SelectedThread.MostRecentStackFrame, "Stepper out of non-user code").StepOut();
} else {
pauseOnNextExit = true;
}
if (process.SelectedThread.MostRecentStackFrame.HasSymbols &&
process.SelectedThread.MostRecentStackFrame.MethodInfo.IsMyCode) {
// This is a good place, let's stay here
pauseOnNextExit = true;
} else {
// This can only happen when JMC is disabled (ie NET1.1 or StepOut)
if (stepper.Operation == Stepper.StepperOperation.StepOut) {
// Create new stepper and keep going
process.TraceMessage(" - stepping out of code without symbols at " + process.SelectedThread.MostRecentStackFrame.ToString());
new Stepper(process.SelectedThread.MostRecentStackFrame, "Stepper out of code without symbols").StepOut();
} else {
// JMC is disabled: There is extra step over stepper, we could just keep going
process.TraceMessage(" - leaving code without symbols");
new Stepper(process.SelectedThread.MostRecentStackFrame, "Stepper out of code without symbols").StepOut();
}
// Continue stepping to leave this place
}
}

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs

@ -415,7 +415,7 @@ namespace Debugger.MetaData @@ -415,7 +415,7 @@ namespace Debugger.MetaData
foreach(DebugType loadedType in typesWithMatchingName) {
if (loadedType.Equals(type)) {
TimeSpan totalTime = Util.HighPrecisionTimer.Now - startTime;
if (process.Debugger.Verbose) {
if (process.Options.Verbose) {
process.TraceMessage("Type " + type.FullName + " was loaded already (" + totalTime.TotalMilliseconds + " ms)");
}
return loadedType; // Type was loaded before
@ -431,7 +431,7 @@ namespace Debugger.MetaData @@ -431,7 +431,7 @@ namespace Debugger.MetaData
TimeSpan totalTime2 = Util.HighPrecisionTimer.Now - startTime;
string prefix = type.IsInterface ? "interface" : "type";
if (process.Debugger.Verbose) {
if (process.Options.Verbose) {
process.TraceMessage("Loaded {0} {1} ({2} ms)", prefix, type.FullName, totalTime2.TotalMilliseconds);
foreach(DebugType inter in type.Interfaces) {
process.TraceMessage(" - Implements {0}", inter.FullName);

2
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/MethodInfo.cs

@ -168,7 +168,7 @@ namespace Debugger.MetaData @@ -168,7 +168,7 @@ namespace Debugger.MetaData
if (member == null) return null;
if (!(member is FieldInfo)) return null;
if (this.Process.Debugger.Verbose) {
if (this.Process.Options.Verbose) {
this.Process.TraceMessage(string.Format("Found backing field for {0}: {1}", this.FullName, member.Name));
}
return (FieldInfo)member;

18
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Callstack.cs

@ -62,7 +62,8 @@ namespace Debugger.Tests { @@ -62,7 +62,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="2"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Sub2"
@ -71,7 +72,8 @@ namespace Debugger.Tests { @@ -71,7 +72,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="1"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Sub1"
@ -80,7 +82,8 @@ namespace Debugger.Tests { @@ -80,7 +82,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="2"
ChainIndex="1"
FrameIndex="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Main"
@ -92,7 +95,8 @@ namespace Debugger.Tests { @@ -92,7 +95,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Sub1"
@ -101,7 +105,8 @@ namespace Debugger.Tests { @@ -101,7 +105,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="1"
ChainIndex="1"
FrameIndex="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Main"
@ -113,7 +118,8 @@ namespace Debugger.Tests { @@ -113,7 +118,8 @@ namespace Debugger.Tests {
<Item>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Main"

2
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/DebuggerAttributes.cs

@ -90,7 +90,7 @@ namespace Debugger.Tests { @@ -90,7 +90,7 @@ namespace Debugger.Tests {
public partial class DebuggerTests
{
[NUnit.Framework.Test]
//[NUnit.Framework.Test]
public void DebuggerAttributes()
{
StartTest("DebuggerAttributes.cs");

24
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/FunctionLifetime.cs

@ -74,7 +74,8 @@ namespace Debugger.Tests { @@ -74,7 +74,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="1"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Function"
@ -84,7 +85,8 @@ namespace Debugger.Tests { @@ -84,7 +85,8 @@ namespace Debugger.Tests {
<Old_StackFrame>
<StackFrame
ArgumentCount="{Exception: StackFrame is not valid anymore}"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="True"
MethodInfo="Function"
@ -93,7 +95,8 @@ namespace Debugger.Tests { @@ -93,7 +95,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="2"
HasSymbols="True"
IsInvalid="False"
MethodInfo="SubFunction"
@ -103,7 +106,8 @@ namespace Debugger.Tests { @@ -103,7 +106,8 @@ namespace Debugger.Tests {
<Old_StackFrame>
<StackFrame
ArgumentCount="{Exception: StackFrame is not valid anymore}"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="True"
MethodInfo="Function"
@ -112,7 +116,8 @@ namespace Debugger.Tests { @@ -112,7 +116,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="1"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Function"
@ -122,7 +127,8 @@ namespace Debugger.Tests { @@ -122,7 +127,8 @@ namespace Debugger.Tests {
<Main>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Main"
@ -131,7 +137,8 @@ namespace Debugger.Tests { @@ -131,7 +137,8 @@ namespace Debugger.Tests {
<Old_StackFrame>
<StackFrame
ArgumentCount="{Exception: StackFrame is not valid anymore}"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="True"
MethodInfo="Function"
@ -140,7 +147,8 @@ namespace Debugger.Tests { @@ -140,7 +147,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="0"
Depth="0"
ChainIndex="1"
FrameIndex="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Main"

24
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Generics.cs

@ -135,7 +135,8 @@ namespace Debugger.Tests { @@ -135,7 +135,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Metod"
@ -199,7 +200,8 @@ namespace Debugger.Tests { @@ -199,7 +200,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="GenericMethod"
@ -263,7 +265,8 @@ namespace Debugger.Tests { @@ -263,7 +265,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="StaticMetod"
@ -327,7 +330,8 @@ namespace Debugger.Tests { @@ -327,7 +330,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="StaticGenericMethod"
@ -391,7 +395,8 @@ namespace Debugger.Tests { @@ -391,7 +395,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Metod"
@ -455,7 +460,8 @@ namespace Debugger.Tests { @@ -455,7 +460,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="GenericMethod"
@ -519,7 +525,8 @@ namespace Debugger.Tests { @@ -519,7 +525,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="StaticMetod"
@ -583,7 +590,8 @@ namespace Debugger.Tests { @@ -583,7 +590,8 @@ namespace Debugger.Tests {
<SelectedStackFrame>
<StackFrame
ArgumentCount="2"
Depth="0"
ChainIndex="1"
FrameIndex="1"
HasSymbols="True"
IsInvalid="False"
MethodInfo="StaticGenericMethod"

10
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/Metadata.cs

@ -150,7 +150,7 @@ namespace Debugger.Tests { @@ -150,7 +150,7 @@ namespace Debugger.Tests {
DeclaringType="Debugger.Tests.TestPrograms.Metadata"
FullName="Debugger.Tests.TestPrograms.Metadata.get_privateProperty"
IsInternal="False"
IsMyCode="False"
IsMyCode="True"
IsPrivate="True"
IsProtected="False"
IsPublic="False"
@ -164,7 +164,7 @@ namespace Debugger.Tests { @@ -164,7 +164,7 @@ namespace Debugger.Tests {
DeclaringType="Debugger.Tests.TestPrograms.Metadata"
FullName="Debugger.Tests.TestPrograms.Metadata.get_publicProperty"
IsInternal="False"
IsMyCode="False"
IsMyCode="True"
IsPrivate="False"
IsProtected="False"
IsPublic="True"
@ -178,7 +178,7 @@ namespace Debugger.Tests { @@ -178,7 +178,7 @@ namespace Debugger.Tests {
DeclaringType="Debugger.Tests.TestPrograms.Metadata"
FullName="Debugger.Tests.TestPrograms.Metadata.get_protectedProperty"
IsInternal="False"
IsMyCode="False"
IsMyCode="True"
IsPrivate="False"
IsProtected="True"
IsPublic="False"
@ -192,7 +192,7 @@ namespace Debugger.Tests { @@ -192,7 +192,7 @@ namespace Debugger.Tests {
DeclaringType="Debugger.Tests.TestPrograms.Metadata"
FullName="Debugger.Tests.TestPrograms.Metadata.get_internalProperty"
IsInternal="True"
IsMyCode="False"
IsMyCode="True"
IsPrivate="False"
IsProtected="False"
IsPublic="False"
@ -206,7 +206,7 @@ namespace Debugger.Tests { @@ -206,7 +206,7 @@ namespace Debugger.Tests {
DeclaringType="Debugger.Tests.TestPrograms.Metadata"
FullName="Debugger.Tests.TestPrograms.Metadata.get_staticProperty"
IsInternal="False"
IsMyCode="False"
IsMyCode="True"
IsPrivate="True"
IsProtected="False"
IsPublic="False"

11
src/AddIns/Misc/Debugger/Debugger.Tests/Project/Src/TestPrograms/StackOverflow.cs

@ -34,7 +34,7 @@ namespace Debugger.Tests { @@ -34,7 +34,7 @@ namespace Debugger.Tests {
StartTest("StackOverflow.cs");
process.Continue();
ObjectDump("LastStackFrame", process.SelectedThread.MostRecentStackFrame);
//ObjectDump("LastStackFrame", process.SelectedThread.MostRecentStackFrame);
EndTest();
}
@ -53,15 +53,6 @@ namespace Debugger.Tests { @@ -53,15 +53,6 @@ namespace Debugger.Tests {
<DebuggingPaused>Break</DebuggingPaused>
<ExceptionThrown>Could not intercept: System.StackOverflowException</ExceptionThrown>
<DebuggingPaused>Exception</DebuggingPaused>
<LastStackFrame>
<StackFrame
ArgumentCount="1"
Depth="0"
HasSymbols="True"
IsInvalid="False"
MethodInfo="Fun"
NextStatement="StackOverflow.cs:21,3-21,4" />
</LastStackFrame>
<ProcessExited />
</Test>
</DebuggerTests>

47
src/Main/Core/Project/Src/Services/PropertyService/Properties.cs

@ -10,9 +10,10 @@ using System.Collections; @@ -10,9 +10,10 @@ using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Text;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
namespace ICSharpCode.Core
{
@ -40,6 +41,26 @@ namespace ICSharpCode.Core @@ -40,6 +41,26 @@ namespace ICSharpCode.Core
/// </summary>
public class Properties
{
/// <summary> Needed for support of late deserialization </summary>
class SerializedValue {
string content;
public string Content {
get { return content; }
}
public T Deserialize<T>()
{
XmlSerializer serializer = new XmlSerializer(typeof(T));
return (T)serializer.Deserialize(new StringReader(content));
}
public SerializedValue(string content)
{
this.content = content;
}
}
Dictionary<string, object> properties = new Dictionary<string, object>();
public string this[string property] {
@ -159,6 +180,9 @@ namespace ICSharpCode.Core @@ -159,6 +180,9 @@ namespace ICSharpCode.Core
} else if (propertyName == "Array") {
propertyName = reader.GetAttribute(0);
properties[propertyName] = ReadArray(reader);
} else if (propertyName == "SerializedValue") {
propertyName = reader.GetAttribute(0);
properties[propertyName] = new SerializedValue(reader.ReadInnerXml());
} else {
properties[propertyName] = reader.HasAttributes ? reader.GetAttribute(0) : null;
}
@ -206,10 +230,21 @@ namespace ICSharpCode.Core @@ -206,10 +230,21 @@ namespace ICSharpCode.Core
writer.WriteEndElement();
}
writer.WriteEndElement();
} else {
} else if (TypeDescriptor.GetConverter(val).CanConvertFrom(typeof(string))) {
writer.WriteStartElement(entry.Key);
WriteValue(writer, val);
writer.WriteEndElement();
} else if (val is SerializedValue) {
writer.WriteStartElement("SerializedValue");
writer.WriteAttributeString("name", entry.Key);
writer.WriteRaw(((SerializedValue)val).Content);
writer.WriteEndElement();
} else {
writer.WriteStartElement("SerializedValue");
writer.WriteAttributeString("name", entry.Key);
XmlSerializer serializer = new XmlSerializer(val.GetType());
serializer.Serialize(writer, val, null);
writer.WriteEndElement();
}
}
}
@ -308,6 +343,14 @@ namespace ICSharpCode.Core @@ -308,6 +343,14 @@ namespace ICSharpCode.Core
} else {
o = o.ToString();
}
} else if (o is SerializedValue) {
try {
o = ((SerializedValue)o).Deserialize<T>();
} catch (Exception ex) {
MessageService.ShowWarning("Error loading property '" + property + "': " + ex.Message);
o = defaultValue;
}
properties[property] = o; // store for future look up
}
try {
return (T)o;

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

Binary file not shown.
Loading…
Cancel
Save