Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Redesigned debugging options panel in XAML.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkonicek committed Jun 27, 2011
1 parent 1b4fa55 commit bbdf7cd
Show file tree
Hide file tree
Showing 11 changed files with 88 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin
Expand Up @@ -167,7 +167,7 @@
insertbefore = "TextEditorOptions"> insertbefore = "TextEditorOptions">
<OptionPanel id = "General" <OptionPanel id = "General"
label = "${res:Dialog.Options.IDEOptions.General}" label = "${res:Dialog.Options.IDEOptions.General}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.DebuggingOptionsPanel"/> class = "Debugger.AddIn.Options.DebuggingOptionsPanel"/>
<OptionPanel id = "Symbols" <OptionPanel id = "Symbols"
label = "${res:Dialog.Options.IDEOptions.Debugging.Symbols}" label = "${res:Dialog.Options.IDEOptions.Debugging.Symbols}"
class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.DebuggingSymbolsPanel"/> class = "ICSharpCode.SharpDevelop.Gui.OptionPanels.DebuggingSymbolsPanel"/>
Expand Down
5 changes: 5 additions & 0 deletions src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
Expand Up @@ -98,6 +98,10 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Options\DebuggingOptionsPanel.xaml.cs">
<DependentUpon>DebuggingOptionsPanel.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Pads\CallStackPad.xaml.cs"> <Compile Include="Pads\CallStackPad.xaml.cs">
<DependentUpon>CallStackPad.xaml</DependentUpon> <DependentUpon>CallStackPad.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
Expand Down Expand Up @@ -392,6 +396,7 @@
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Options\DebuggingOptionsPanel.xaml" />
<Page Include="Pads\CallStackPad.xaml" /> <Page Include="Pads\CallStackPad.xaml" />
<Page Include="Pads\Controls\ConditionCell.xaml" /> <Page Include="Pads\Controls\ConditionCell.xaml" />
<Page Include="Pads\Controls\SimpleListViewControl.xaml" /> <Page Include="Pads\Controls\SimpleListViewControl.xaml" />
Expand Down
@@ -1,15 +1,18 @@
// 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 BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt) // This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)


using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;

using Debugger; using Debugger;
using ICSharpCode.Core; using ICSharpCode.Core;


namespace ICSharpCode.SharpDevelop.Services namespace ICSharpCode.SharpDevelop.Services
{ {
public enum ShowIntegersAs { Auto, Decimal, Hexadecimal }; public enum ShowIntegersAs { Auto, Decimal, Hexadecimal };


[Serializable]
public class DebuggingOptions: Options public class DebuggingOptions: Options
{ {
public static DebuggingOptions Instance { public static DebuggingOptions Instance {
Expand Down
@@ -0,0 +1,39 @@
<gui:OptionPanel x:Class="Debugger.AddIn.Options.DebuggingOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sd="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui;assembly=ICSharpCode.SharpDevelop"
xmlns:debugger="clr-namespace:ICSharpCode.SharpDevelop.Services;assembly=Debugger.AddIn"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets">
<StackPanel>
<GroupBox Margin="5" Header="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<CheckBox x:Name="chbStepOverFieldAccessProperties"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.StepOverFieldAccessProperties}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.StepOverFieldAccessProperties}" />
<CheckBox x:Name="chbStepOverSingleLineProperties"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.StepOverSingleLineProperties}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.StepOverSingleLineProperties}" />
<CheckBox x:Name="chbStepOverAllProperties"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.StepOverAllProperties}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.StepOverAllProperties}" />
<CheckBox x:Name="chbStepOverDebuggerAttributes"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.StepOverDebuggerAttributes}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.StepOverDebuggerAttributes}" />
<CheckBox x:Name="chbStepOverNoSymbols"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.StepOverNoSymbols}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.StepOverNoSymbols}" />
<CheckBox x:Name="chbEnableJustMyCode"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.Stepping.EnableJustMyCode}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.EnableJustMyCode}" />
</widgets:StackPanelWithSpacing>
</GroupBox>
<GroupBox Margin="5" Header="{sd:Localize Dialog.Options.IDEOptions.Debugging.Exceptions}">
<widgets:StackPanelWithSpacing SpaceBetweenItems="5">
<CheckBox x:Name="chbPauseOnHandledExceptions"
Content="{sd:Localize Dialog.Options.IDEOptions.Debugging.PauseOnHandledExceptions}"
IsChecked="{sd:OptionBinding debugger:DebuggingOptions.PauseOnHandledExceptions}" />
</widgets:StackPanelWithSpacing>
</GroupBox>
</StackPanel>
</gui:OptionPanel>
@@ -0,0 +1,29 @@
// 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;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;

using ICSharpCode.SharpDevelop.Gui;

namespace Debugger.AddIn.Options
{
/// <summary>
/// Interaction logic for DebuggingOptionsPanel.xaml
/// </summary>
public partial class DebuggingOptionsPanel : OptionPanel
{
public DebuggingOptionsPanel()
{
InitializeComponent();
}
}
}
Expand Up @@ -10,6 +10,7 @@
using Debugger.MetaData; using Debugger.MetaData;
using ICSharpCode.SharpDevelop.Debugging; using ICSharpCode.SharpDevelop.Debugging;
using Debugger.AddIn.Visualizers.Utils; using Debugger.AddIn.Visualizers.Utils;
using ICSharpCode.SharpDevelop.Services;


namespace Debugger.AddIn.Visualizers namespace Debugger.AddIn.Visualizers
{ {
Expand Down Expand Up @@ -45,6 +46,7 @@ public override void Execute()
{ {
if (this.Expression == null) if (this.Expression == null)
return; return;
System.Windows.MessageBox.Show("StepOverSingle " + DebuggingOptions.Instance.StepOverSingleLineProperties);
var objectGraphWindow = ObjectGraphWindow.EnsureShown(); var objectGraphWindow = ObjectGraphWindow.EnsureShown();
objectGraphWindow.ShownExpression = this.Expression; objectGraphWindow.ShownExpression = this.Expression;
} }
Expand Down
3 changes: 2 additions & 1 deletion src/AddIns/Debugger/Debugger.Core/ManagedCallback.cs
Expand Up @@ -498,7 +498,8 @@ public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, I
// Watch out for the zeros and null! // Watch out for the zeros and null!
// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0); // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);


if ((ExceptionType)exceptionType == ExceptionType.Unhandled || process.PauseOnHandledException) { if ((ExceptionType)exceptionType == ExceptionType.Unhandled ||
(process.Options != null && process.Options.PauseOnHandledException)) {
process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference()); process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState; process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType; process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType;
Expand Down
5 changes: 4 additions & 1 deletion src/AddIns/Debugger/Debugger.Core/Options.cs
@@ -1,8 +1,10 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt) using System;
// 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) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt)


namespace Debugger namespace Debugger
{ {
[Serializable]
public class Options public class Options
{ {
public bool EnableJustMyCode = true; public bool EnableJustMyCode = true;
Expand All @@ -14,5 +16,6 @@ public class Options
public bool Verbose = false; public bool Verbose = false;
public string[] SymbolsSearchPaths = new string[0]; public string[] SymbolsSearchPaths = new string[0];
public bool SuspendOtherThreads = true; public bool SuspendOtherThreads = true;
public bool PauseOnHandledException = false;
} }
} }
7 changes: 0 additions & 7 deletions src/AddIns/Debugger/Debugger.Core/Process.cs
Expand Up @@ -209,15 +209,8 @@ public unsafe int WriteMemory(ulong address, byte[] buffer)


#region Exceptions #region Exceptions


bool pauseOnHandledException = false;

public event EventHandler<ExceptionEventArgs> ExceptionThrown; public event EventHandler<ExceptionEventArgs> ExceptionThrown;


public bool PauseOnHandledException {
get { return pauseOnHandledException; }
set { pauseOnHandledException = value; }
}

protected internal virtual void OnExceptionThrown(ExceptionEventArgs e) protected internal virtual void OnExceptionThrown(ExceptionEventArgs e)
{ {
TraceMessage ("Debugger event: OnExceptionThrown()"); TraceMessage ("Debugger event: OnExceptionThrown()");
Expand Down
Expand Up @@ -13,7 +13,7 @@


namespace ICSharpCode.SharpDevelop.Refactoring namespace ICSharpCode.SharpDevelop.Refactoring
{ {
public class ContextActionsPopupHelper public class ContextActionsHelper
{ {
public static ContextActionsPopup MakePopupWithDerivedClasses(IClass baseClass) public static ContextActionsPopup MakePopupWithDerivedClasses(IClass baseClass)
{ {
Expand Down
3 changes: 2 additions & 1 deletion src/Main/ICSharpCode.Core.Presentation/OptionBinding.cs
Expand Up @@ -15,7 +15,8 @@ namespace ICSharpCode.Core.Presentation
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Properties accessed by this binding have to be managed by a custom /// Properties accessed by this binding have to be managed by a custom
/// settings class, which contains all settings as static properties or fields.<br /> /// settings class, which contains all settings as static properties or fields,
/// or is a singleton class with the standard 'Instance' property.<br />
/// Do not use PropertyService directly!<br /> /// Do not use PropertyService directly!<br />
/// This markup extension can only be used in OptionPanels or other <br />containers implementing IOptionBindingContainer! /// This markup extension can only be used in OptionPanels or other <br />containers implementing IOptionBindingContainer!
/// </remarks> /// </remarks>
Expand Down

0 comments on commit bbdf7cd

Please sign in to comment.