diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index 41a4ea20..7717e8f7 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -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); } }