public override void Process(ILInstruction ilInstruction, string operandString)
 {
     this.writer.WriteLine("IL_{0:x4}: {1,-4}| {2, -8}",
         ilInstruction.Offset,
         ilInstruction.OpCode.Value.ToString("x2"),
         operandString);
 }
 public virtual void Process(ILInstruction ilInstruction, string operandString)
 {
     this.writer.WriteLine("IL_{0:x4}: {1,-10} {2}",
         ilInstruction.Offset,
         ilInstruction.OpCode.Name,
         operandString);
 }
 public virtual string Format(ILInstruction ilInstruction)
 {
     string processed = null;
     try
     {
         processed = ilInstruction.ProcessedOperand;
     }
     catch (Exception ex)
     {
         processed = "!" + EscapedString(ex.Message) + "!";
     }
     return String.Format("IL_{0:x4}: /* {1,-4}| {2, -8} */ {3,-10} {4}",
         ilInstruction.Offset,
         ilInstruction.OpCode.Value.ToString("x2"),
         ilInstruction.RawOperand,
         ilInstruction.OpCode.Name,
         processed
     );
 }
Ejemplo n.º 4
0
            public void Process(ILInstruction instruction, string operandString)
            {
                if (m_starts.Contains(instruction.Offset))
                {
                    m_mbi.AddInstruction(m_indent + ".try");
                    m_mbi.AddInstruction(m_indent + "{");
                    Indent();
                }

                if (m_ends.Contains(instruction.Offset))
                {
                    Dedent();
                    m_mbi.AddInstruction(m_indent + "}");
                }

                if (m_endCatch.Contains(instruction.Offset))
                {
                    Dedent();
                    m_mbi.AddInstruction(m_indent + "}");
                }

                var t = default(Type);
                if (m_startCatch.TryGetValue(instruction.Offset, out t))
                {
                    m_mbi.AddInstruction(m_indent + $"catch {t.ToIL()}");
                    m_mbi.AddInstruction(m_indent + "{");
                    Indent();
                }

                if (m_startFilter.Contains(instruction.Offset))
                {
                    m_mbi.AddInstruction(m_indent + "filter");
                    m_mbi.AddInstruction(m_indent + "{");
                    Indent();
                }

                if (m_startFinally.Contains(instruction.Offset))
                {
                    m_mbi.AddInstruction(m_indent + "finally");
                    m_mbi.AddInstruction(m_indent + "{");
                    Indent();
                }

                if (m_startFault.Contains(instruction.Offset))
                {
                    m_mbi.AddInstruction(m_indent + "fault");
                    m_mbi.AddInstruction(m_indent + "{");
                    Indent();
                }

                m_mbi.AddInstruction(string.Format("{3}IL_{0:x4}: {1,-10} {2}",
                    instruction.Offset,
                    instruction.OpCode.Name,
                    operandString,
                    m_indent));
            }
Ejemplo n.º 5
0
 private void AddInstruction(string inst, ILInstruction instruction)
 {
     this.m_instructions.Add(inst);
       this.m_realInstructions.Add(instruction);
 }
Ejemplo n.º 6
0
 public void Process(ILInstruction instruction, string operandString)
 {
     this.m_mbi.AddInstruction(string.Format("IL_{0:x4}: {1,-10} {2}", (object) instruction.Offset, (object) instruction.OpCode.Name, (object) operandString), instruction);
 }