public static IEnumerable<OperationLocation> LocatedOperations(this IMethodDefinition method, PdbReader pdb) { return (from o in method.Body.Operations from l in pdb.GetPrimarySourceLocationsFor(o.Location) select new OperationLocation { Operation = o, Location = l }).ToList(); }
private static IEnumerable<IPrimarySourceLocation> GetValidLocations(this IObjectWithLocations locatable, PdbReader pdb) { return from l in pdb.GetPrimarySourceLocationsFor(locatable.Locations) where l.Length != 0 select l; }
private void ProcessMethodDefinition(IMethodDefinition methodDefinition, PdbReader pdbReader) { uint token = GetMethodToken_ByReadingInternals(methodDefinition); if (token != 0) { var locations = pdbReader.GetPrimarySourceLocationsFor(methodDefinition.Locations); var enumerator = locations.GetEnumerator(); if (enumerator.MoveNext()) { IPrimarySourceLocation location = enumerator.Current; map.Add(token, new CodeLocation(location.PrimarySourceDocument.Location, location.StartLine, 0)); } } }