Browse Source

Update UI when debugged stopped.

Show BP for each language.
pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
0249d17827
  1. 7
      Debugger/Debugger.Core/BreakpointCollection.cs
  2. 3
      Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs
  3. 4
      Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs
  4. 2
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs
  5. 4
      Debugger/ILSpy.Debugger/Services/ParserService/ParserService.cs
  6. 32
      ILSpy/MainWindow.xaml.cs

7
Debugger/Debugger.Core/BreakpointCollection.cs

@ -66,6 +66,13 @@ namespace Debugger @@ -66,6 +66,13 @@ namespace Debugger
base.Remove(breakpoint);
}
public void RemoveAll()
{
for (int i = Count - 1; i >= 0; --i) {
this[i].Remove();
}
}
protected override void OnRemoved(Breakpoint breakpoint)
{
breakpoint.Deactivate();

3
Debugger/ILSpy.Debugger/AvalonEdit/IconBarMargin.cs

@ -80,6 +80,9 @@ namespace ILSpy.Debugger.AvalonEdit @@ -80,6 +80,9 @@ namespace ILSpy.Debugger.AvalonEdit
foreach (var bm in BookmarkManager.Bookmarks) {
if (CurrentType == null || bm.TypeName != CurrentType.FullName)
continue;
if (bm is BreakpointBookmark &&
((BreakpointBookmark)bm).Language != DebuggerService.CurrentDebugger.Language)
continue;
int line = bm.LineNumber;
BookmarkBase existingBookmark;

4
Debugger/ILSpy.Debugger/Bookmarks/BreakpointBookmark.cs

@ -38,7 +38,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -38,7 +38,7 @@ namespace ILSpy.Debugger.Bookmarks
string tooltip;
BreakpointAction action = BreakpointAction.Break;
public DecompiledLanguages Laguage { get; private set; }
public DecompiledLanguages Language { get; private set; }
public BreakpointAction Action {
get {
@ -89,7 +89,7 @@ namespace ILSpy.Debugger.Bookmarks @@ -89,7 +89,7 @@ namespace ILSpy.Debugger.Bookmarks
{
this.action = action;
this.tooltip = language.ToString();
this.Laguage = language;
this.Language = language;
}
public override ImageSource Image {

2
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -500,7 +500,7 @@ namespace ILSpy.Debugger.Services @@ -500,7 +500,7 @@ namespace ILSpy.Debugger.Services
var storage = CodeMappings.GetStorage(Language);
if (Language == bookmark.Laguage) {
if (Language == bookmark.Language) {
uint token;
SourceCodeMapping map =
storage.GetInstructionByTypeAndLine(

4
Debugger/ILSpy.Debugger/Services/ParserService/ParserService.cs

@ -78,12 +78,12 @@ namespace ILSpy.Debugger.Services @@ -78,12 +78,12 @@ namespace ILSpy.Debugger.Services
int left = offset, right = offset;
//search left
while((!mySet.Contains(currentValue) || currentValue == ".") && offset >= 0)
while((!mySet.Contains(currentValue) || currentValue == ".") && left > 0)
currentValue = fullText[--left].ToString();
currentValue = fullText[offset].ToString();
// searh right
while(!mySet.Contains(currentValue) && offset < fullText.Length - 2)
while(!mySet.Contains(currentValue) && right < fullText.Length - 2)
currentValue = fullText[++right].ToString();
return fullText.Substring(left + 1, right - 1 - left).Trim();

32
ILSpy/MainWindow.xaml.cs

@ -319,28 +319,26 @@ namespace ICSharpCode.ILSpy @@ -319,28 +319,26 @@ namespace ICSharpCode.ILSpy
if (window.ShowDialog() == true)
{
if (DebuggerService.CurrentDebugger.IsDebugging) {
AttachMenuItem.IsEnabled = AttachButton.IsEnabled = false;
ContinueDebuggingMenuItem.IsEnabled =
StepIntoMenuItem.IsEnabled =
StepOverMenuItem.IsEnabled =
StepOutMenuItem.IsEnabled =
DetachMenuItem.IsEnabled = true;
EnableDebuggerUI(false);
DebuggerService.CurrentDebugger.DebugStopped += OnDebugStopped;
}
}
}
}
void OnDebugStopped(object sender, EventArgs e)
{
EnableDebuggerUI(true);
DebuggerService.CurrentDebugger.DebugStopped -= OnDebugStopped;
}
void DetachFromProcessExecuted(object sender, ExecutedRoutedEventArgs e)
{
if (DebuggerService.CurrentDebugger.IsDebugging){
DebuggerService.CurrentDebugger.Detach();
AttachMenuItem.IsEnabled = AttachButton.IsEnabled = true;
ContinueDebuggingMenuItem.IsEnabled =
StepIntoMenuItem.IsEnabled =
StepOverMenuItem.IsEnabled =
StepOutMenuItem.IsEnabled =
DetachMenuItem.IsEnabled = false;
EnableDebuggerUI(true);
DebuggerService.CurrentDebugger.DebugStopped -= OnDebugStopped;
}
}
@ -391,6 +389,16 @@ namespace ICSharpCode.ILSpy @@ -391,6 +389,16 @@ namespace ICSharpCode.ILSpy
base.OnKeyUp(e);
}
void EnableDebuggerUI(bool enable)
{
AttachMenuItem.IsEnabled = AttachButton.IsEnabled = enable;
ContinueDebuggingMenuItem.IsEnabled =
StepIntoMenuItem.IsEnabled =
StepOverMenuItem.IsEnabled =
StepOutMenuItem.IsEnabled =
DetachMenuItem.IsEnabled = !enable;
}
#endregion
#region Exit/About

Loading…
Cancel
Save