示例#1
0
        // note: sadly it's not possible to cache all the [count] allocations and reuse them.
        // a NRE is throw if the size of the arrays does not match SequencePointCount :(
        void ReadSequencePoints(ISymbolMethod method, IDictionary instructions)
        {
            int count = method.SequencePointCount;

            int []             offsets     = new int [count];
            ISymbolDocument [] docs        = new ISymbolDocument [count];
            int []             startColumn = new int [count];
            int []             endColumn   = new int [count];
            int []             startRow    = new int [count];
            int []             endRow      = new int [count];
            method.GetSequencePoints(offsets, docs, startRow, startColumn, endRow, endColumn);

            for (int i = 0; i < offsets.Length; i++)
            {
                Cil.Instruction instr = (Cil.Instruction)instructions [offsets [i]];

                Cil.SequencePoint sp = new Cil.SequencePoint(GetDocument(docs [i]));
                sp.StartLine   = startRow [i];
                sp.StartColumn = startColumn [i];
                sp.EndLine     = endRow [i];
                sp.EndColumn   = endColumn [i];

                instr.SequencePoint = sp;
            }
        }
示例#2
0
        void ReadSequencePoints(ISymbolMethod method, Hashtable instructions)
        {
            int count = method.SequencePointCount;
            int [] offsets = new int [count];
            ISymbolDocument [] docs = new ISymbolDocument [count];
            int [] startColumn = new int [count];
            int [] endColumn = new int [count];
            int [] startRow = new int [count];
            int [] endRow = new int [count];
            method.GetSequencePoints (offsets, docs, startRow, startColumn, endRow, endColumn);

            for (int i = 0; i < offsets.Length; i++) {
                Cil.Instruction instr = (Cil.Instruction) instructions [offsets [i]];

                Cil.SequencePoint sp = new Cil.SequencePoint (GetDocument (docs [i]));
                sp.StartLine = startRow [i];
                sp.StartColumn = startColumn [i];
                sp.EndLine = endRow [i];
                sp.EndColumn = endColumn [i];

                instr.SequencePoint = sp;
            }
        }