示例#1
0
        public static DebugInfo.SequencePoint GetCurrentSequencePoint(this DebugInfo.Method method, int instructionPointer)
        {
            var sequencePoints = method.SequencePoints;
            if (sequencePoints.Count == 0)
            {
                throw new InvalidOperationException($"{method.Name} has no sequence points");
            }

            for (int i = sequencePoints.Count - 1; i >= 0; i--)
            {
                if (instructionPointer >= sequencePoints[i].Address)
                    return sequencePoints[i];
            }

            return sequencePoints[0];
        }
示例#2
0
 public static bool TryGetMethod(this DebugInfo debugInfo, int instructionPointer, [MaybeNullWhen(false)] out DebugInfo.Method method)
 {
     method = debugInfo.GetMethod(instructionPointer);
     return(method != null);
 }