Browse Source

Show loop head in disassembly view.

pull/1/head
Daniel Grunwald 15 years ago
parent
commit
dbdb2c1561
  1. 2
      ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs
  2. 2
      ICSharpCode.Decompiler/FlowAnalysis/ControlFlowGraph.cs
  3. 2
      ICSharpCode.Decompiler/FlowAnalysis/ControlFlowGraphBuilder.cs
  4. 2
      ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs
  5. 26
      ICSharpCode.Decompiler/FlowAnalysis/ControlStructureDetector.cs
  6. 23
      ICSharpCode.Decompiler/FlowAnalysis/OpCodeInfo.cs
  7. 2
      ICSharpCode.Decompiler/FlowAnalysis/SimplifyByRefCalls.cs
  8. 2
      ICSharpCode.Decompiler/FlowAnalysis/SsaBlock.cs
  9. 2
      ICSharpCode.Decompiler/FlowAnalysis/SsaInstruction.cs
  10. 2
      ICSharpCode.Decompiler/FlowAnalysis/SsaOptimization.cs
  11. 2
      ICSharpCode.Decompiler/FlowAnalysis/SsaVariable.cs
  12. 2
      ICSharpCode.Decompiler/FlowAnalysis/TransformToSsa.cs
  13. 2
      ILSpy/Disassembler/DisassemblerHelpers.cs
  14. 10
      ILSpy/Disassembler/ILLanguage.cs
  15. 3
      ILSpy/MainWindow.xaml.cs

2
ICSharpCode.Decompiler/FlowAnalysis/ControlFlowEdge.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/ControlFlowGraph.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/ControlFlowGraphBuilder.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/ControlFlowNode.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

26
ICSharpCode.Decompiler/FlowAnalysis/ControlStructureDetector.cs

@ -1,9 +1,21 @@ @@ -1,9 +1,21 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision$</version>
// </file>
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.IO;
@ -14,7 +26,7 @@ using Mono.Cecil.Cil; @@ -14,7 +26,7 @@ using Mono.Cecil.Cil;
namespace ICSharpCode.Decompiler.FlowAnalysis
{
/// <summary>
/// Description of DominanceLoopDetector.
/// Detects the structure of the control flow (exception blocks and loops).
/// </summary>
public class ControlStructureDetector
{

23
ICSharpCode.Decompiler/FlowAnalysis/OpCodeInfo.cs

@ -1,9 +1,20 @@ @@ -1,9 +1,20 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <author name="Daniel Grunwald"/>
// <version>$Revision: 776 $</version>
// </file>
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;

2
ICSharpCode.Decompiler/FlowAnalysis/SimplifyByRefCalls.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/SsaBlock.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/SsaInstruction.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/SsaOptimization.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/SsaVariable.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ICSharpCode.Decompiler/FlowAnalysis/TransformToSsa.cs

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
// Copyright (c) 2010 Daniel Grunwald
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software

2
ILSpy/Disassembler/DisassemblerHelpers.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.ILSpy.Disassembler @@ -25,7 +25,7 @@ namespace ICSharpCode.ILSpy.Disassembler
{
static class DisassemblerHelpers
{
static void WriteOffsetReference(ITextOutput writer, Instruction instruction)
public static void WriteOffsetReference(ITextOutput writer, Instruction instruction)
{
writer.WriteReference(CecilExtensions.OffsetToString(instruction.Offset), instruction);
}

10
ILSpy/Disassembler/ILLanguage.cs

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// 4
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
@ -84,7 +84,13 @@ namespace ICSharpCode.ILSpy.Disassembler @@ -84,7 +84,13 @@ namespace ICSharpCode.ILSpy.Disassembler
if (s.Type != ControlStructureType.Root) {
switch (s.Type) {
case ControlStructureType.Loop:
output.WriteCommentLine("// loop start");
output.Write("// loop start");
if (s.EntryPoint.Start != null) {
output.Write(" (head: ");
DisassemblerHelpers.WriteOffsetReference(output, s.EntryPoint.Start);
output.Write(')');
}
output.WriteLine();
break;
case ControlStructureType.Try:
output.WriteLine(".try {");

3
ILSpy/MainWindow.xaml.cs

@ -55,7 +55,8 @@ namespace ICSharpCode.ILSpy @@ -55,7 +55,8 @@ namespace ICSharpCode.ILSpy
typeof(System.Windows.FrameworkElement).Assembly,
typeof(ICSharpCode.TreeView.SharpTreeView).Assembly,
typeof(Mono.Cecil.AssemblyDefinition).Assembly,
typeof(MainWindow).Assembly
typeof(MainWindow).Assembly,
typeof(ICSharpCode.Decompiler.GraphVizGraph).Assembly
};
public MainWindow()

Loading…
Cancel
Save