Browse Source

Only breakpoints are visible in breakpoints list (except debugger option "Show all bookmarks" is active)

pull/263/head
Ronny Klier 14 years ago
parent
commit
d518e3c4e0
  1. 15
      Debugger/ILSpy.Debugger/DebuggerSettings.cs
  2. 37
      Debugger/ILSpy.Debugger/UI/BreakpointPanel.xaml.cs
  3. 2
      Debugger/ILSpy.Debugger/UI/CallStackPanel.xaml.cs
  4. 1
      Debugger/ILSpy.Debugger/UI/DebuggerSettingsPanel.xaml
  5. 14
      Debugger/ILSpy.Debugger/UI/DebuggerSettingsPanel.xaml.cs

15
Debugger/ILSpy.Debugger/DebuggerSettings.cs

@ -11,6 +11,7 @@ namespace ICSharpCode.ILSpy.Debugger @@ -11,6 +11,7 @@ namespace ICSharpCode.ILSpy.Debugger
bool showWarnings = true;
bool askArguments = true;
bool debugWholeTypesOnly = false;
bool showAllBookmarks = false;
/// <summary>
/// Show warnings messages.
@ -56,6 +57,20 @@ namespace ICSharpCode.ILSpy.Debugger @@ -56,6 +57,20 @@ namespace ICSharpCode.ILSpy.Debugger
}
}
/// <summary>
/// Show all bookmarks in breakpoints window.
/// </summary>
[DefaultValue(false)]
public bool ShowAllBookmarks {
get { return showAllBookmarks; }
set {
if (showAllBookmarks != value) {
showAllBookmarks = value;
OnPropertyChanged("ShowAllBookmarks");
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)

37
Debugger/ILSpy.Debugger/UI/BreakpointPanel.xaml.cs

@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@ -9,8 +11,11 @@ using System.Windows.Data; @@ -9,8 +11,11 @@ using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.ILSpy;
using ICSharpCode.ILSpy.Bookmarks;
using ICSharpCode.ILSpy.Debugger.Bookmarks;
using ICSharpCode.ILSpy.Options;
namespace ILSpyPlugin
{
@ -36,9 +41,11 @@ namespace ILSpyPlugin @@ -36,9 +41,11 @@ namespace ILSpyPlugin
private BreakpointPanel()
{
InitializeComponent();
view.ItemsSource = BookmarkManager.Bookmarks;
BookmarkManager.Added += new BookmarkEventHandler(OnAdded);
BookmarkManager.Removed += new BookmarkEventHandler(OnRemoved);
SetItemSource();
BookmarkManager.Added += delegate { SetItemSource(); };
BookmarkManager.Removed += delegate { SetItemSource(); };
DebuggerSettingsPanel.CurrentDebuggerSettings.PropertyChanged +=
delegate(object s, PropertyChangedEventArgs e) { if (e.PropertyName == "ShowAllBookmarks") SetItemSource(); };
}
public void Show()
@ -47,20 +54,21 @@ namespace ILSpyPlugin @@ -47,20 +54,21 @@ namespace ILSpyPlugin
MainWindow.Instance.ShowInBottomPane("Breakpoints", this);
}
private void OnAdded(object sender, BookmarkEventArgs e)
{
view.ItemsSource = null;
view.ItemsSource = BookmarkManager.Bookmarks;
}
private void OnRemoved(object sender, BookmarkEventArgs e)
{
view.ItemsSource = null;
view.ItemsSource = BookmarkManager.Bookmarks;
}
private void SetItemSource()
{
view.ItemsSource = null;
if (DebuggerSettingsPanel.CurrentDebuggerSettings.ShowAllBookmarks)
view.ItemsSource = BookmarkManager.Bookmarks;
else
view.ItemsSource = BookmarkManager.Bookmarks.Where(b => b is BreakpointBookmark);
}
public void Closed()
{
BookmarkManager.Added -= delegate { SetItemSource(); };
BookmarkManager.Removed -= delegate { SetItemSource(); };
DebuggerSettingsPanel.CurrentDebuggerSettings.PropertyChanged -=
delegate(object s, PropertyChangedEventArgs e) { if (e.PropertyName == "ShowAllBookmarks") SetItemSource(); };
}
void view_MouseDoubleClick(object sender, MouseButtonEventArgs e)
@ -70,7 +78,6 @@ namespace ILSpyPlugin @@ -70,7 +78,6 @@ namespace ILSpyPlugin
var selectedItem = view.SelectedItem as BookmarkBase;
if (null == selectedItem)
return;
// TODO: Line should be part of jump target
MainWindow.Instance.JumpToReference(selectedItem.MemberReference);
MainWindow.Instance.TextView.UnfoldAndScroll(selectedItem.LineNumber);
e.Handled = true;

2
Debugger/ILSpy.Debugger/UI/CallStackPanel.xaml.cs

@ -187,6 +187,8 @@ namespace ILSpyPlugin @@ -187,6 +187,8 @@ namespace ILSpyPlugin
if (mr == null)
return;
MainWindow.Instance.JumpToReference(mr);
// TODO: jump to associated line
// MainWindow.Instance.TextView.UnfoldAndScroll(selectedItem.LineNumber);
e.Handled = true;
}
}

1
Debugger/ILSpy.Debugger/UI/DebuggerSettingsPanel.xaml

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
<StackPanel Margin="10">
<CheckBox IsChecked="{Binding ShowWarnings}">Show warning messages</CheckBox>
<CheckBox IsChecked="{Binding AskForArguments}">Ask for arguments and working directory before executing a process</CheckBox>
<CheckBox IsChecked="{Binding ShowAllBookmarks}">Show all bookmarks in breakpoints window</CheckBox>
</StackPanel>
</Grid>
</UserControl>

14
Debugger/ILSpy.Debugger/UI/DebuggerSettingsPanel.xaml.cs

@ -19,9 +19,10 @@ namespace ICSharpCode.ILSpy.Options @@ -19,9 +19,10 @@ namespace ICSharpCode.ILSpy.Options
[ExportOptionPage(Title = "Debugger", Order = 2)]
partial class DebuggerSettingsPanel : UserControl, IOptionPage
{
private const string DEBUGGER_SETTINGS = "DebuggerSettings";
private const string SHOW_WARNINGS = "showWarnings";
private const string ASK_ARGUMENTS = "askForArguments";
private static readonly string DEBUGGER_SETTINGS = "DebuggerSettings";
private static readonly string SHOW_WARNINGS = "showWarnings";
private static readonly string ASK_ARGUMENTS = "askForArguments";
private static readonly string SHOW_BOOKMARKS = "showAllBookmarks";
public DebuggerSettingsPanel()
{
@ -30,7 +31,7 @@ namespace ICSharpCode.ILSpy.Options @@ -30,7 +31,7 @@ namespace ICSharpCode.ILSpy.Options
public void Load(ILSpySettings settings)
{
this.DataContext = LoadDebuggerSettings(settings);
this.DataContext = CurrentDebuggerSettings;
}
static DebuggerSettings currentDebuggerSettings;
@ -47,7 +48,7 @@ namespace ICSharpCode.ILSpy.Options @@ -47,7 +48,7 @@ namespace ICSharpCode.ILSpy.Options
DebuggerSettings s = new DebuggerSettings();
s.ShowWarnings = (bool?)e.Attribute(SHOW_WARNINGS) ?? s.ShowWarnings;
s.AskForArguments = (bool?)e.Attribute(ASK_ARGUMENTS) ?? s.AskForArguments;
s.ShowAllBookmarks = (bool?)e.Attribute(SHOW_BOOKMARKS) ?? s.ShowAllBookmarks;
return s;
}
@ -57,14 +58,13 @@ namespace ICSharpCode.ILSpy.Options @@ -57,14 +58,13 @@ namespace ICSharpCode.ILSpy.Options
XElement section = new XElement(DEBUGGER_SETTINGS);
section.SetAttributeValue(SHOW_WARNINGS, s.ShowWarnings);
section.SetAttributeValue(ASK_ARGUMENTS, s.AskForArguments);
section.SetAttributeValue(SHOW_BOOKMARKS, s.ShowAllBookmarks);
XElement existingElement = root.Element(DEBUGGER_SETTINGS);
if (existingElement != null)
existingElement.ReplaceWith(section);
else
root.Add(section);
currentDebuggerSettings = null; // invalidate cached settings
}
}
}
Loading…
Cancel
Save