/// <summary> /// Dump the subset of methods common to both sides of the diff to the given dumper. /// </summary> /// <param name="dumper">Output dumper to use</param> /// <param name="signatureFilter">Set of common signatures of methods to dump</param> private void DumpCommonMethods(Dumper dumper, int moduleIndex, Dictionary <string, MethodPair> signatureFilter) { IEnumerable <ReadyToRunMethod> filteredMethods = TryGetMethods(dumper.Reader, moduleIndex) .Where(method => signatureFilter.ContainsKey(method.SignatureString)) .OrderBy(method => method.SignatureString); foreach (ReadyToRunMethod method in filteredMethods) { dumper.DumpMethod(method); } }
/// <summary> /// Dump the subset of methods common to both sides of the diff to the given dumper. /// </summary> /// <param name="dumper">Output dumper to use</param> /// <param name="signatureFilter">Set of common signatures of methods to dump</param> private void DumpCommonMethods(Dumper dumper, HashSet <string> signatureFilter) { IEnumerable <ReadyToRunMethod> filteredMethods = dumper .Reader .Methods .Where(method => signatureFilter.Contains(method.SignatureString)) .OrderBy(method => method.SignatureString); foreach (ReadyToRunMethod method in filteredMethods) { dumper.DumpMethod(method); } }
/// <summary> /// Dump the subset of methods common to both sides of the diff to the given dumper. /// </summary> /// <param name="dumper">Output dumper to use</param> /// <param name="signatureFilter">Set of common signatures of methods to dump</param> private void DumpCommonMethods(Dumper dumper, ReadyToRunSection section, Dictionary <string, MethodPair> signatureFilter) { if (!TryGetMethods(dumper.Reader, section, out IReadOnlyList <ReadyToRunMethod> sectionMethods)) { IEnumerable <ReadyToRunMethod> filteredMethods = sectionMethods .Where(method => signatureFilter.ContainsKey(method.SignatureString)) .OrderBy(method => method.SignatureString); foreach (ReadyToRunMethod method in filteredMethods) { dumper.DumpMethod(method); } } }
// <summary> /// For each query in the list of queries, search for all methods matching the query by name, signature or id /// </summary> /// <param name="r2r">Contains all the extracted info about the ReadyToRun image</param> /// <param name="title">The title to print, "R2R Methods by Query" or "R2R Methods by Keyword"</param> /// <param name="queries">The keywords/ids to search for</param> /// <param name="exact">Specifies whether to look for methods with names/signatures/ids matching the method exactly or partially</param> private void QueryMethod(R2RReader r2r, string title, IReadOnlyList <string> queries, bool exact) { if (queries.Count > 0) { _dumper.WriteDivider(title); } foreach (string q in queries) { IList <R2RMethod> res = FindMethod(r2r, q, exact); XmlNode queryNode = _dumper.DumpQueryCount(q, "Methods", res.Count); foreach (R2RMethod method in res) { _dumper.DumpMethod(method, queryNode); } } }