public static bool TryGetMethod(this DebugInfo debugInfo, int instructionPointer, [MaybeNullWhen(false)] out DebugInfo.Method method) { method = debugInfo.GetMethod(instructionPointer); return(method != null); }
public static DebugInfo.Method?GetMethod(this DebugInfo debugInfo, int instructionPointer) { return(debugInfo.Methods .SingleOrDefault(m => m.Range.Start <= instructionPointer && instructionPointer <= m.Range.End)); }