public void GetWatchpointId() { watchpoint.Bind(); int id = watchpoint.GetId(); Assert.AreEqual(EXPECTED_ID, id); }
public int GetWatchpointRefCount(IWatchpoint watchpoint) { int currentCount = 0; int id = watchpoint.GetId(); if (id != -1) { watchpointsCount.TryGetValue(id, out currentCount); } return(currentCount); }
public void RegisterWatchpoint(IWatchpoint watchpoint) { int id = watchpoint.GetId(); if (id != -1) { watchpoints[id] = watchpoint; int currentCount; watchpointsCount.TryGetValue(id, out currentCount); watchpointsCount[id] = currentCount + 1; } else { Trace.WriteLine( "Failed to register pending watchpoint: watchpoint does not have an ID."); } debugEngineHandler.OnWatchpointBound(watchpoint, debugProgram); }
public void SetUp() { taskContext = new JoinableTaskContext(); mockBreakpointRequest = Substitute.For <IDebugBreakpointRequest2>(); mockTarget = Substitute.For <RemoteTarget>(); mockProgram = Substitute.For <IGgpDebugProgram>(); mockPendingBreakpoint = Substitute.For <IPendingBreakpoint>(); mockPendingBreakpoint.GetId().Returns(ID); mockWatchpoint = Substitute.For <IWatchpoint>(); mockWatchpoint.GetId().Returns(ID); mockPendingBreakpointFactory = Substitute.For <DebugPendingBreakpoint.Factory>(); mockWatchpointFactory = Substitute.For <DebugWatchpoint.Factory>(); var mockDebugEngineHandler = Substitute.For <IDebugEngineHandler>(); breakpointManager = new LldbBreakpointManager.Factory(taskContext, mockPendingBreakpointFactory, mockWatchpointFactory).Create(mockDebugEngineHandler, mockProgram); mockPendingBreakpointFactory.Create(breakpointManager, mockProgram, mockBreakpointRequest, mockTarget).ReturnsForAnyArgs(mockPendingBreakpoint); mockWatchpointFactory.Create(breakpointManager, mockBreakpointRequest, mockTarget, mockProgram).ReturnsForAnyArgs(mockWatchpoint); }
public void UnregisterWatchpoint(IWatchpoint watchpoint) { int id = watchpoint.GetId(); if (id != -1) { int currentCount; watchpointsCount.TryGetValue(id, out currentCount); if (currentCount > 1) { watchpointsCount[id] = currentCount - 1; } else if (currentCount == 1) { watchpointsCount.Remove(id); watchpoints.Remove(id); } } else { Trace.WriteLine( "Failed to unregister pending watchpoint: watchpoint does not have an ID."); } }