public void HandleEventWatchpointNoWatchpoint() { MockThread(_mockRemoteThread, StopReason.WATCHPOINT, _watchpointStopData); _mockBreakpointManager.GetWatchpointById(Arg.Any <int>(), out IWatchpoint _) .ReturnsForAnyArgs(x => { x[1] = null; return(false); }); RaiseSingleStateChanged(); _mockDebugEngineHandler.Received(1).SendEvent(Arg.Is <DebugEvent>(x => x is BreakEvent), _mockProgram, _mockRemoteThread); }
public void RegisterAndRetrieveWatchpoint() { IWatchpoint watchpoint; bool result = breakpointManager.GetWatchpointById(ID, out watchpoint); Assert.IsFalse(result); breakpointManager.RegisterWatchpoint(mockWatchpoint); result = breakpointManager.GetWatchpointById(ID, out watchpoint); Assert.IsTrue(result); Assert.AreEqual(ID, watchpoint.GetId()); int watchpointCount = breakpointManager.GetWatchpointRefCount(mockWatchpoint); Assert.AreEqual(1, watchpointCount); }
/// <summary> /// Handle a watchpoint stop event. /// </summary> DebugEvent HandleWatchpointStop(RemoteThread thread) { int id = (int)thread.GetStopReasonDataAtIndex(0); if (!_lldbBreakpointManager.GetWatchpointById(id,out IWatchpoint watchpoint)) { return(null); } IDebugBoundBreakpoint2[] boundBreakpoints = { watchpoint }; return(new BreakpointEvent(_boundBreakpointEnumFactory.Create(boundBreakpoints))); }