Exemplo n.º 1
0
        private static void AddLineMapping(
            MethodBase method,
            ISymUnmanagedDocument documentInfo,
            Dictionary <int, MethodBase> methodLineMapping,
            ISymUnmanagedReader reader)
        {
            var implMethod = ResolveBestMethodInfo(method);

            var docName = documentInfo.GetName();
            var points  = reader.GetMethod(implMethod.MetadataToken).GetSequencePoints();

            foreach (var point in points)
            {
                if (point.IsHidden)
                {
                    continue;
                }

                if (point.Document.GetName() != docName)
                {
                    continue;
                }

                for (var i = point.StartLine; i <= point.EndLine; i++)
                {
                    // DONTTOUCH: DO NOT change to .Add(). Mapping may be overwritten; last method wins.
                    methodLineMapping[i] = method;
                }
            }
        }