// ISymUnmanagedMethod

        public static SequencePoint[] GetSequencePoints(this ISymUnmanagedMethod symMethod, int codesize)
        {
            uint count = symMethod.GetSequencePointCount();

            ISymUnmanagedDocument[] documents = new ISymUnmanagedDocument[count];
            uint[] offsets    = new uint[count];
            uint[] lines      = new uint[count];
            uint[] columns    = new uint[count];
            uint[] endLines   = new uint[count];
            uint[] endColumns = new uint[count];

            symMethod.GetSequencePoints(
                count,
                out count,
                offsets,
                documents,
                lines,
                columns,
                endLines,
                endColumns
                );

            var sequencePoints = new SequencePoint[count];
            var urls           = documents.Distinct().ToDictionary(d => d, d => d.GetURL());
            var sums           = documents.Distinct().ToDictionary(d => d, d => d.GetCheckSum());

            uint token = symMethod.GetToken();

            for (int i = 0; i < count; i++)
            {
                sequencePoints[i] = new SequencePoint()
                {
                    MethodDefToken = token,
                    ILRanges       = new [] { new ILRange((int)offsets[i], i + 1 < count ? (int)offsets[i + 1] : codesize) },
                    Filename       = urls[documents[i]],
                    FileCheckSum   = sums[documents[i]],
                    StartLine      = (int)lines[i],
                    StartColumn    = (int)columns[i],
                    EndLine        = (int)endLines[i],
                    EndColumn      = (int)endColumns[i]
                };
            }

            return(sequencePoints);
        }
Ejemplo n.º 2
0
		// ISymUnmanagedMethod
		
		public static SequencePoint[] GetSequencePoints(this ISymUnmanagedMethod symMethod, int codesize)
		{
			uint count = symMethod.GetSequencePointCount();
			
			ISymUnmanagedDocument[] documents = new ISymUnmanagedDocument[count];
			uint[] offsets    = new uint[count];
			uint[] lines      = new uint[count];
			uint[] columns    = new uint[count];
			uint[] endLines   = new uint[count];
			uint[] endColumns = new uint[count];
			                  
			symMethod.GetSequencePoints(
				count,
				out count,
				offsets,
				documents,
				lines,
				columns,
				endLines,
				endColumns
			);
			
			var sequencePoints = new SequencePoint[count];
			var urls = documents.Distinct().ToDictionary(d => d, d => d.GetURL());
			var sums = documents.Distinct().ToDictionary(d => d, d => d.GetCheckSum());
			
			uint token = symMethod.GetToken();
			for(int i = 0; i < count; i++) {
				sequencePoints[i] = new SequencePoint() {
					MethodDefToken = token,
					ILRanges = new [] { new ILRange((int)offsets[i], i + 1 < count ? (int)offsets[i + 1] : codesize) },
					Filename = urls[documents[i]],
					FileCheckSum = sums[documents[i]],
					StartLine = (int)lines[i],
					StartColumn = (int)columns[i],
					EndLine = (int)endLines[i],
					EndColumn = (int)endColumns[i]
				};
			}
			
			return sequencePoints;
		}