Browse Source

1. create a status label for debugging status.

2. if the NGEN flag cannot be set, move on.
pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
ea612974d2
  1. 6
      Debugger/Debugger.Core/ManagedCallback.cs
  2. 12
      ILSpy/Commands/DebuggerCommands.cs
  3. 28
      ILSpy/MainWindow.xaml
  4. 7
      ILSpy/MainWindow.xaml.cs

6
Debugger/Debugger.Core/ManagedCallback.cs

@ -323,7 +323,11 @@ namespace Debugger @@ -323,7 +323,11 @@ namespace Debugger
// disable NGen
ICorDebugProcess2 pProcess2 = pProcess as ICorDebugProcess2;
if (pProcess2 != null && Process.DebugMode == DebugModeFlag.Debug) {
pProcess2.SetDesiredNGENCompilerFlags((uint)CorDebugJITCompilerFlags.CORDEBUG_JIT_DISABLE_OPTIMIZATION);
try {
pProcess2.SetDesiredNGENCompilerFlags((uint)CorDebugJITCompilerFlags.CORDEBUG_JIT_DISABLE_OPTIMIZATION);
} catch (COMException) {
// we cannot set the NGEN flag => no evaluation for optimized code.
}
}
ExitCallback();

12
ILSpy/Commands/DebuggerCommands.cs

@ -8,6 +8,7 @@ using System.Windows; @@ -8,6 +8,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using ILSpy.Debugger;
using ILSpy.Debugger.Bookmarks;
@ -106,6 +107,8 @@ namespace ICSharpCode.ILSpy.Commands @@ -106,6 +107,8 @@ namespace ICSharpCode.ILSpy.Commands
EnableDebuggerUI(false);
CurrentDebugger.DebugStopped += OnDebugStopped;
CurrentDebugger.IsProcessRunningChanged += CurrentDebugger_IsProcessRunningChanged;
MainWindow.Instance.SetStatus("Running...", Brushes.Black);
}
protected void OnDebugStopped(object sender, EventArgs e)
@ -113,6 +116,8 @@ namespace ICSharpCode.ILSpy.Commands @@ -113,6 +116,8 @@ namespace ICSharpCode.ILSpy.Commands
EnableDebuggerUI(true);
CurrentDebugger.DebugStopped -= OnDebugStopped;
CurrentDebugger.IsProcessRunningChanged -= CurrentDebugger_IsProcessRunningChanged;
MainWindow.Instance.SetStatus("Stand by...", Brushes.Black);
}
protected void EnableDebuggerUI(bool enable)
@ -144,6 +149,7 @@ namespace ICSharpCode.ILSpy.Commands @@ -144,6 +149,7 @@ namespace ICSharpCode.ILSpy.Commands
{
if (CurrentDebugger.IsProcessRunning) {
//SendWpfWindowPos(this, HWND_BOTTOM);
MainWindow.Instance.SetStatus("Running...", Brushes.Black);
return;
}
@ -158,6 +164,8 @@ namespace ICSharpCode.ILSpy.Commands @@ -158,6 +164,8 @@ namespace ICSharpCode.ILSpy.Commands
MainWindow.Instance.TextView.UnfoldAndScroll(CurrentLineBookmark.Instance.LineNumber);
}
MainWindow.Instance.SetStatus("Debugging...", Brushes.Red);
}
}
@ -195,8 +203,10 @@ namespace ICSharpCode.ILSpy.Commands @@ -195,8 +203,10 @@ namespace ICSharpCode.ILSpy.Commands
{
public override void Execute(object parameter)
{
if (CurrentDebugger.IsDebugging && !CurrentDebugger.IsProcessRunning)
if (CurrentDebugger.IsDebugging && !CurrentDebugger.IsProcessRunning) {
CurrentDebugger.Continue();
MainWindow.Instance.SetStatus("Running...", Brushes.Black);
}
}
}

28
ILSpy/MainWindow.xaml

@ -33,17 +33,25 @@ @@ -33,17 +33,25 @@
</Window.CommandBindings>
<DockPanel>
<!-- Main menu -->
<Menu DockPanel.Dock="Top" Name="mainMenu">
<MenuItem Header="_File" /> <!-- contents of file menu are added using MEF -->
<MenuItem Header="_View">
<MenuItem Header="Show _internal types and members" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowInternalApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
<DockPanel DockPanel.Dock="Top" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
<Menu DockPanel.Dock="Left" Name="mainMenu">
<MenuItem Header="_File" /> <!-- contents of file menu are added using MEF -->
<MenuItem Header="_View">
<MenuItem Header="Show _internal types and members" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowInternalApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Show _analyzer" Name="showAnalyzer" IsCheckable="True" Checked="ShowAnalyzer_Checked" Unchecked="ShowAnalyzer_Unchecked" />
</MenuItem>
<MenuItem Header="Show _analyzer" Name="showAnalyzer" IsCheckable="True" Checked="ShowAnalyzer_Checked" Unchecked="ShowAnalyzer_Unchecked" />
</MenuItem>
</Menu>
</Menu>
<TextBlock VerticalAlignment="Center"
HorizontalAlignment="Right"
DockPanel.Dock="Right"
x:Name="StatusLabel"
Width="70"
Text="Stand by..."/>
</DockPanel>
<!-- ToolBar -->
<ToolBar
Name="toolBar"

7
ILSpy/MainWindow.xaml.cs

@ -29,6 +29,7 @@ using System.Windows; @@ -29,6 +29,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using ICSharpCode.Decompiler;
@ -563,5 +564,11 @@ namespace ICSharpCode.ILSpy @@ -563,5 +564,11 @@ namespace ICSharpCode.ILSpy
{
treeView.UnselectAll();
}
public void SetStatus(string status, Brush foreground)
{
this.StatusLabel.Foreground = foreground;
this.StatusLabel.Text = status;
}
}
}
Loading…
Cancel
Save