| 854 | } |
| 855 | |
| 856 | bool DbgEngAdapter::RemoveBreakpoint(const DebugBreakpoint& breakpoint) |
| 857 | { |
| 858 | bool done = false; |
| 859 | ULONG numBreakpoints {}; |
| 860 | if (m_debugControl->GetNumberBreakpoints(&numBreakpoints) != S_OK) |
| 861 | return false; |
| 862 | |
| 863 | for (size_t i = 0; i < numBreakpoints; i++) |
| 864 | { |
| 865 | IDebugBreakpoint2* bp {}; |
| 866 | if (m_debugControl->GetBreakpointByIndex2(i, &bp) != S_OK) |
| 867 | continue; |
| 868 | |
| 869 | ULONG64 address {}; |
| 870 | if (bp->GetOffset(&address) != S_OK) |
| 871 | continue; |
| 872 | |
| 873 | // Right now, only the address info of the breakpoint is valid. |
| 874 | // Once the ID info is also valid, we can call GetBreakpointById2() to get the breakpoint by ID. |
| 875 | if (address == breakpoint.m_address) |
| 876 | { |
| 877 | m_debugControl->RemoveBreakpoint2(bp); |
| 878 | done = true; |
| 879 | break; |
| 880 | } |
| 881 | } |
| 882 | return done; |
| 883 | } |
| 884 | |
| 885 | bool DbgEngAdapter::RemoveBreakpoint(const ModuleNameAndOffset& breakpoint) |
| 886 | { |
nothing calls this directly
no outgoing calls
no test coverage detected