Browse Source

Improve debug UI

pull/728/merge
Daniel Grunwald 9 years ago
parent
commit
6343ab7c15
  1. 6
      ICSharpCode.Decompiler/IL/Instructions/ILFunction.cs
  2. 5
      ICSharpCode.Decompiler/IL/Transforms/BlockTransform.cs
  3. 4
      ILSpy/Languages/ILAstLanguage.cs

6
ICSharpCode.Decompiler/IL/Instructions/ILFunction.cs

@ -83,7 +83,11 @@ namespace ICSharpCode.Decompiler.IL @@ -83,7 +83,11 @@ namespace ICSharpCode.Decompiler.IL
this.CheckInvariant(ILPhase.Normal);
foreach (var transform in transforms) {
context.CancellationToken.ThrowIfCancellationRequested();
context.Stepper.StartGroup(transform.GetType().Name);
if (transform is BlockILTransform blockTransform) {
context.Stepper.StartGroup(blockTransform.ToString());
} else {
context.Stepper.StartGroup(transform.GetType().Name);
}
transform.Run(this, context);
this.CheckInvariant(ILPhase.Normal);
context.Stepper.EndGroup(keepIfEmpty: true);

5
ICSharpCode.Decompiler/IL/Transforms/BlockTransform.cs

@ -63,6 +63,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -63,6 +63,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms
public IList<IBlockTransform> PreOrderTransforms { get; } = new List<IBlockTransform>();
public IList<IBlockTransform> PostOrderTransforms { get; } = new List<IBlockTransform>();
public override string ToString()
{
return $"{nameof(BlockILTransform)} ({string.Join(", ", PreOrderTransforms.Concat(PostOrderTransforms).Select(t => t.GetType().Name))})";
}
public void Run(ILFunction function, ILTransformContext context)
{
var blockContext = new BlockTransformContext(context);

4
ILSpy/Languages/ILAstLanguage.cs

@ -168,6 +168,10 @@ namespace ICSharpCode.ILSpy @@ -168,6 +168,10 @@ namespace ICSharpCode.ILSpy
OnStepperUpdated(new EventArgs());
}
}
(output as ISmartTextOutput)?.AddButton(Images.ViewCode, "Show Steps", delegate {
DebugSteps.Show();
});
output.WriteLine();
il.WriteTo(output);
}
}

Loading…
Cancel
Save