Пример #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));
        }
        private ErrorTraceInstr getCorrespondingInst(InstrLocation from, ErrorTraceInstr toInstr, InsertionTrans tinfo)
        {
            if (from.type.type == InstrTypeEnum.CALL || from.type.type == InstrTypeEnum.ASYNC)
            {
                // Get callee trace
                ErrorTrace calleeTrace = null;
                if (toInstr.isCall())
                {
                    calleeTrace = (toInstr as CallInstr).calleeTrace;
                }
                // recursively mapBack the callee trace
                if (calleeTrace != null)
                {
                    calleeTrace = tinfo.mapBackTrace(calleeTrace);
                }

                return(new CallInstr(from.type.callee, calleeTrace, (from.type.type == InstrTypeEnum.ASYNC ? true : false), toInstr.info));
            }
            else
            {
                return(new IntraInstr(toInstr.info));
            }
        }