Browse Source

Breakpoint enhancements

- Icon for disabled breakpoints
- First step to breakpoint context menu in IconBarMargin
- Breakpoints are not deleted and recreated any longer
  when content of decompile window changes
pull/263/head
Ronny Klier 14 years ago
parent
commit
88a0194a6b
  1. 23
      Debugger/ILSpy.Debugger/Commands/BreakpointCommand.cs
  2. 16
      ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs
  3. 4
      ILSpy.SharpDevelop.LGPL/Bookmarks/BreakpointBookmark.cs
  4. 1
      ILSpy.SharpDevelop.LGPL/Images.cs
  5. 1
      ILSpy/ILSpy.csproj
  6. BIN
      ILSpy/Images/DisabledBreakpoint.png

23
Debugger/ILSpy.Debugger/Commands/BreakpointCommand.cs

@ -1,9 +1,13 @@ @@ -1,9 +1,13 @@
// 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.Linq;
using System.Windows;
using ICSharpCode.Decompiler;
using ICSharpCode.ILSpy.AvalonEdit;
using ICSharpCode.ILSpy.Bookmarks;
using ICSharpCode.ILSpy.Debugger.Bookmarks;
using ICSharpCode.ILSpy.Debugger.Services;
namespace ICSharpCode.ILSpy.Debugger.Commands
@ -47,4 +51,23 @@ namespace ICSharpCode.ILSpy.Debugger.Commands @@ -47,4 +51,23 @@ namespace ICSharpCode.ILSpy.Debugger.Commands
}
}
}
[ExportBookmarkContextMenuEntry(Header="Disable Breakpoint", Category="Debugger")]
public class DisableBreakpointCommand : IBookmarkContextMenuEntry
{
public bool IsVisible(IBookmark[] bookmarks)
{
return bookmarks.Any(b => b is BreakpointBookmark && (b as BreakpointBookmark).IsEnabled);
}
public bool IsEnabled(IBookmark[] bookmarks)
{
return true;
}
public void Execute(IBookmark[] bookmarks)
{
throw new NotImplementedException();
}
}
}

16
ILSpy.SharpDevelop.LGPL/AvalonEdit/IconBarMargin.cs

@ -266,11 +266,17 @@ namespace ICSharpCode.ILSpy.AvalonEdit @@ -266,11 +266,17 @@ namespace ICSharpCode.ILSpy.AvalonEdit
member.MetadataToken.ToInt32(), breakpoint.ILRange.From, out isMatch);
if (map != null) {
newBookmarks.Add(new BreakpointBookmark(
member, new AstLocation(map.SourceCodeLine, 0),
map.ILInstructionOffset, BreakpointAction.Break, DebugInformation.Language));
BookmarkManager.RemoveMark(breakpoint);
// update bookmark
breakpoint.MemberReference = member;
breakpoint.Location = new AstLocation(map.SourceCodeLine, 0);
breakpoint.ILRange = map.ILInstructionOffset;
// Why were the breakpoints removed and recreated
// newBookmarks.Add(new BreakpointBookmark(
// member, new AstLocation(map.SourceCodeLine, 0),
// map.ILInstructionOffset, BreakpointAction.Break, DebugInformation.Language));
//
// BookmarkManager.RemoveMark(breakpoint);
}
}

4
ILSpy.SharpDevelop.LGPL/Bookmarks/BreakpointBookmark.cs

@ -40,7 +40,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks @@ -40,7 +40,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks
}
}
public ILRange ILRange { get; private set; }
public ILRange ILRange { get; set; }
public virtual bool IsHealthy {
get {
@ -82,7 +82,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks @@ -82,7 +82,7 @@ namespace ICSharpCode.ILSpy.Debugger.Bookmarks
public override ImageSource Image {
get {
return Images.Breakpoint;
return IsEnabled ? Images.Breakpoint : Images.DisabledBreakpoint;
}
}

1
ILSpy.SharpDevelop.LGPL/Images.cs

@ -25,6 +25,7 @@ namespace ICSharpCode.ILSpy.SharpDevelop @@ -25,6 +25,7 @@ namespace ICSharpCode.ILSpy.SharpDevelop
}
public static readonly BitmapImage Breakpoint = LoadBitmap("Breakpoint");
public static readonly BitmapImage DisabledBreakpoint = LoadBitmap("DisabledBreakpoint");
public static readonly BitmapImage CurrentLine = LoadBitmap("CurrentLine");
public static ImageSource GetImage(string imageName)

1
ILSpy/ILSpy.csproj

@ -210,6 +210,7 @@ @@ -210,6 +210,7 @@
<None Include="app.config" />
<Resource Include="Images\Breakpoint.png" />
<Resource Include="Images\CurrentLine.png" />
<Resource Include="Images\DisabledBreakpoint.png" />
<None Include="Properties\AssemblyInfo.template.cs" />
<Compile Include="Properties\WPFAssemblyInfo.cs" />
<Compile Include="MainWindow.xaml.cs">

BIN
ILSpy/Images/DisabledBreakpoint.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Loading…
Cancel
Save