Exemple #1
0
 private void Dissect()
 {
     WaitDissector.DissectResult dresult = WaitDissector.Dissect(_code.Method);
     _states           = dresult.States;
     _dissectionPoints = dresult.DissectionPoints;
     _cfgLookup        = _dissectionPoints
                         .Select((k, i) => Tuple.Create(k, _states[i]))
                         .ToLookup(t => t.Item1, t => t.Item2);
 }
Exemple #2
0
        public static DissectResult Dissect(MethodBase mb)
        {
            MethodBodyReader mbr = new MethodBodyReader(mb);
            WaitDissector    wd  = new WaitDissector(mbr.instructions);

            wd.Dissect();
            EnsureNotInitBehavior(mbr.instructions, wd.DissectionPoints[0], mb.Name);
            List <MethodCode> states = new List <MethodCode>();
            HashSet <int>     exits  = new HashSet <int>(wd.DissectionPoints);

            foreach (int ilIndex in wd.DissectionPoints)
            {
                MethodCode mc = MethodCode.Create(mb, ilIndex + 1, exits);
                states.Add(mc);
            }
            return(new DissectResult(states, wd.DissectionPoints));
        }