Esempio n. 1
0
        public Trace GenerateTrace()
        {
            Trace t = new Trace();

            for (TraversalInfo ti = this; ti.Predecessor != null; ti = ti.Predecessor)
            {
                if (ZingerConfiguration.CompactTraces && !ti.Predecessor.HasMultipleSuccessors)
                {
                    // Its obvious how we got here, don't waste space
                    // storing this trace step
                    continue;
                }
                ViaChoose vc = ti.Via as ViaChoose;
                ViaExecute ve = ti.Via as ViaExecute;

                if (vc != null)
                    t.InsertStep(new TraceStep(false, vc.ChoiceNumber));
                else if (ve != null)
                    t.InsertStep(new TraceStep(true, ve.ProcessExecuted));
                else
                    throw new NotImplementedException("Summaries not yet supported in traces");
            }

            return t;
        }
Esempio n. 2
0
        /// <summary>
        /// Generate Noncompact trace for Error Reporting
        /// </summary>
        /// <returns></returns>
        public Trace GenerateNonCompactTrace()
        {
            Trace t = new Trace();

            for (TraversalInfo ti = this; ti.Predecessor != null; ti = ti.Predecessor)
            {
                ViaChoose vc = ti.Via as ViaChoose;
                ViaExecute ve = ti.Via as ViaExecute;

                if (vc != null)
                    t.InsertStep(new TraceStep(false, vc.ChoiceNumber));
                else if (ve != null)
                    t.InsertStep(new TraceStep(true, ve.ProcessExecuted));
                else
                    throw new NotImplementedException("Summaries not yet supported in traces");
            }

            return t;
        }