示例#1
0
        public override ErrorTrace mapBackTrace(ErrorTrace trace)
        {
            trace = trace.Copy();

            // delete tid info
            deleteTidInfo(trace);

            // Map back across async call instrumentation
            trace = tinfo_async.mapBackTrace(trace);

            // insert context switch info according to blockExecutionContextMap
            insertContextSwitchInfo(trace);

            // Propagate the context switch info to other places -- this is
            // necessary to get the context info to the Cmds that actually
            // access global variables
            ErrorTrace.fillInContextSwitchInfo(trace);

            return(tinfo_instrument.mapBackTrace(trace));
        }
        // Print an interleaved trace, using the execution context information present
        // in trace
        public static void print(PersistentCBAProgram program, ErrorTrace trace, string file)
        {
            trace = trace.Copy();
            ErrorTrace.fillInContextSwitchInfo(trace);

            printConsole = false;
            setupPrint(program, trace, file);
            collectAllEvents(trace);
            arrangeEvents();

            // compute LOC
            var stks = new HashSet <string>();

            foreach (var ev in events)
            {
                stks.Add(ev.filename + "::" + ev.lineno.ToString());
            }
            LOC = stks.Count;

            // Print the failing assert
            foreach (var ev in events)
            {
                if (ev.extra.Contains("ASSERTION FAILS"))
                {
                    Console.WriteLine("{0}({1},1): error PF5001: This assertion can fail", sanitizeFileName(ev.filename), ev.lineno);
                }
            }
            Console.WriteLine();

            foreach (var ev in events)
            {
                ev.printEvent();
            }

            if (pathFile != null)
            {
                pathFile.Close();
            }
        }