コード例 #1
0
        /// <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();
        }
コード例 #2
0
        [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());
        }