From 0759063d55a234b7a01ed8d33dfe267c746bd5a2 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 24 Aug 2014 11:49:26 +0200 Subject: [PATCH] add ChooseExceptionsDialog for PauseOnHandledException feature --- data/resources/StringResources.resx | 12 +++++ .../Debugger.AddIn/Debugger.AddIn.csproj | 5 ++ .../Options/ChooseExceptionsDialog.xaml | 45 ++++++++++++++++ .../Options/ChooseExceptionsDialog.xaml.cs | 49 +++++++++++++++++ .../Options/DebuggingOptions.cs | 5 ++ .../Options/DebuggingOptionsPanel.xaml | 5 ++ .../Options/DebuggingOptionsPanel.xaml.cs | 22 ++++++++ .../Debugger/Debugger.Core/ManagedCallback.cs | 51 +++++++++++++++++- src/AddIns/Debugger/Debugger.Core/Options.cs | 53 +++++++++++++++++++ .../Project/Debugging/IDebuggerService.cs | 6 ++- 10 files changed, 250 insertions(+), 3 deletions(-) create mode 100644 src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml create mode 100644 src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml.cs diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index 0fd83c63fb..aebaee76a4 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -8204,4 +8204,16 @@ a line break Only insert selected code completion entry by typing <Tab> or <Enter>. + + Choose exceptions you want the debugger to break on + + + Break on + + + Exception name expression (wildcards are allowed) + + + Choose exceptions + \ No newline at end of file diff --git a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj index ddaadde216..1815ee4e71 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj +++ b/src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj @@ -105,6 +105,10 @@ + + ChooseExceptionsDialog.xaml + Code + DebuggingOptionsPanel.xaml Code @@ -319,6 +323,7 @@ + diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml b/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml new file mode 100644 index 0000000000..1522cee9c6 --- /dev/null +++ b/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml.cs new file mode 100644 index 0000000000..e96cc000d0 --- /dev/null +++ b/src/AddIns/Debugger/Debugger.AddIn/Options/ChooseExceptionsDialog.xaml.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team +// +// Permission is hereby granted, free of charge, to any person obtaining a copy of this +// software and associated documentation files (the "Software"), to deal in the Software +// without restriction, including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons +// to whom the Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all copies or +// substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE +// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Windows; +using ICSharpCode.SharpDevelop.Gui; + +namespace Debugger.AddIn.Options +{ + /// + /// Interaction logic for ChooseExceptionsDialog.xaml + /// + public partial class ChooseExceptionsDialog : Window + { + public ChooseExceptionsDialog(IEnumerable entries) + { + InitializeComponent(); + + FormLocationHelper.ApplyWindow(this, "Debugger.ChooseExceptionsDialog", true); + + ExceptionFilterList = new ObservableCollection(entries); + dataGrid.ItemsSource = ExceptionFilterList; + } + + public IList ExceptionFilterList { get; set; } + + void Button_Click(object sender, RoutedEventArgs e) + { + DialogResult = true; + } + } +} \ No newline at end of file diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs index 6fe518e798..4af0fabf3e 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptions.cs @@ -85,6 +85,11 @@ namespace ICSharpCode.SharpDevelop.Services set { PS.Set("Debugger.PauseOnHandledExceptions", value); } } + public override IEnumerable ExceptionFilterList { + get { return PS.GetList("Debugger.ExceptionFilterList"); } + set { PS.SetList("Debugger.ExceptionFilterList", value); } + } + public bool AskForArguments { get { return PS.Get("Debugger.AskForArguments", false); } set { PS.Set("Debugger.AskForArguments", value); } diff --git a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml index 9a6b7c713c..95432a91a1 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml +++ b/src/AddIns/Debugger/Debugger.AddIn/Options/DebuggingOptionsPanel.xaml @@ -19,7 +19,12 @@ +