/// <summary> /// Prints the text representation of the CFG using MethodDefinition object. /// </summary> /// <param name='methodDef'> /// Method def. /// </param> /// <param name='textView'> /// The Gtk.TextView used to be printed on. /// </param> /// private static void PrintMethod(MethodDefinition methodDef, Gtk.TextView textView) { textView.Buffer.Clear(); ControlFlowGraph <Instruction> cfg = new CilToControlFlowGraph().Decompile(methodDef); textView.Buffer.Text = cfg.ToString(); }
[Test, TestCaseSource("GetTestCases")] /*Comes from the base class*/ public void Cases(string filename) { MethodDefinition[] mDefs = LoadTestCaseMethod(filename); CilToControlFlowGraph transformer = new CilToControlFlowGraph(); List <ControlFlowGraph <Instruction> > cfgs = new List <ControlFlowGraph <Instruction> >(); foreach (MethodDefinition mDef in mDefs) { cfgs.Add(transformer.Transform(mDef)); } RunTestCase(filename, cfgs.ToArray()); }