Fixed seg fault bug when clearing HW breakpoints in EDBG driver

This commit is contained in:
Nav
2023-09-22 20:52:17 +01:00
parent 9698d83cb4
commit 46bbf9cb31

View File

@@ -428,8 +428,8 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
}
// Clear all hardware breakpoints
for (const auto& [address, breakpointNumber] : this->hardwareBreakpointNumbersByAddress) {
this->clearHardwareBreakpoint(address);
while (!this->hardwareBreakpointNumbersByAddress.empty()) {
this->clearHardwareBreakpoint(this->hardwareBreakpointNumbersByAddress.begin()->first);
}
}