| 3768 | } |
| 3769 | |
| 3770 | void WinDebugger::DeleteBreakpoint(Breakpoint* breakpoint) |
| 3771 | { |
| 3772 | AutoCrit autoCrit(mDebugManager->mCritSect); |
| 3773 | |
| 3774 | WdBreakpoint* wdBreakpoint = (WdBreakpoint*)breakpoint; |
| 3775 | |
| 3776 | while (wdBreakpoint != NULL) |
| 3777 | { |
| 3778 | BfLogDbg("WinDebugger::DeleteBreakpoint %p Count:%d\n", wdBreakpoint, mBreakpoints.size()); |
| 3779 | |
| 3780 | if (wdBreakpoint == mActiveBreakpoint) |
| 3781 | mActiveBreakpoint = NULL; |
| 3782 | |
| 3783 | if (wdBreakpoint->mCondition != NULL) |
| 3784 | { |
| 3785 | if (!wdBreakpoint->mIsLinkedSibling) |
| 3786 | delete wdBreakpoint->mCondition; |
| 3787 | } |
| 3788 | |
| 3789 | if (wdBreakpoint->mMemoryBreakpointInfo != NULL) |
| 3790 | { |
| 3791 | for (int memoryWatchSlot = 0; memoryWatchSlot < 4; memoryWatchSlot++) |
| 3792 | { |
| 3793 | if (mMemoryBreakpoints[memoryWatchSlot].mBreakpoint == wdBreakpoint) |
| 3794 | { |
| 3795 | mFreeMemoryBreakIndices.push_back(memoryWatchSlot); |
| 3796 | mMemoryBreakpoints[memoryWatchSlot] = WdMemoryBreakpointBind(); |
| 3797 | mMemoryBreakpointVersion++; |
| 3798 | UpdateThreadDebugRegisters(); |
| 3799 | } |
| 3800 | } |
| 3801 | |
| 3802 | wdBreakpoint->mMemoryBreakpointInfo->mMemoryWatchSlotBitmap = 0; |
| 3803 | } |
| 3804 | |
| 3805 | if (wdBreakpoint->mAddr != 0) |
| 3806 | { |
| 3807 | mBreakpointAddrMap.Remove(wdBreakpoint->mAddr, wdBreakpoint); |
| 3808 | RemoveBreakpoint(wdBreakpoint->mAddr); |
| 3809 | |
| 3810 | for (auto thread : mThreadList) |
| 3811 | { |
| 3812 | if (thread->mIsAtBreakpointAddress == wdBreakpoint->mAddr) |
| 3813 | thread->mIsAtBreakpointAddress = NULL; |
| 3814 | if (thread->mBreakpointAddressContinuing == wdBreakpoint->mAddr) |
| 3815 | thread->mBreakpointAddressContinuing = NULL; |
| 3816 | } |
| 3817 | } |
| 3818 | |
| 3819 | if (!wdBreakpoint->mIsLinkedSibling) |
| 3820 | { |
| 3821 | mBreakpoints.Remove(wdBreakpoint); |
| 3822 | } |
| 3823 | |
| 3824 | auto nextBreakpoint = (WdBreakpoint*)wdBreakpoint->mLinkedSibling; |
| 3825 | delete wdBreakpoint; |
| 3826 | |
| 3827 | wdBreakpoint = nextBreakpoint; |
no test coverage detected