/// <summary> /// Creates the frames for upsert. /// </summary> /// <param name="positions">The positions.</param> /// <param name="breakRecord">The break record.</param> /// <param name="options">The options.</param> /// <returns>List<Frame>.</returns> internal List <Frame> CreateFramesForUpsert(PositionsResult positions, PositionsRecord breakRecord, IndexOptions options) { var frames = positions .Where(positionRecord => positionRecord.Position == breakRecord.Position) .Select(positionRecord => TimeTravelFacade.GetCurrentFrame(positionRecord.ThreadId)) .ToList(); return(frames); }
/// <summary> /// Parses the positions command text. /// </summary> /// <param name="positionsText">The positions text.</param> /// <returns>IEnumerable<PositionsRecord>.</returns> private static IEnumerable <PositionsRecord> ParsePositionsCommandText(string positionsText) { var matches = Regex.Matches(positionsText, "(?<cur>>)?Thread ID=0x(?<tid>[A-F0-9]+) - Position: (?<maj>[A-F0-9]+):(?<min>[A-F0-9]+)"); return(matches.Cast <Match>().Select(x => { var threadId = Convert.ToInt32(x.Groups["tid"].Value, 16); var position = new Position(Convert.ToInt32(x.Groups["maj"].Value, 16), Convert.ToInt32(x.Groups["min"].Value, 16)); var isThreadWithBreak = x.Groups["cur"].Success; var item = new PositionsRecord(threadId, position, isThreadWithBreak); return item; })); }
/// <summary> /// Equalses the specified other. /// </summary> /// <param name="other">The other.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> private bool Equals(PositionsRecord other) { return(ThreadId == other.ThreadId && Position.Equals(other.Position) && IsCurrentThread == other.IsCurrentThread); }