diff --git a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugTranslator.cpp b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugTranslator.cpp index 62e35636..bb6e5c58 100644 --- a/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugTranslator.cpp +++ b/src/DebugToolDrivers/Protocols/RiscVDebugSpec/DebugTranslator.cpp @@ -97,6 +97,11 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec this->reset(); this->triggerDescriptorsByIndex = this->discoverTriggers(); + if (!this->triggerDescriptorsByIndex.empty()) { + // Clear any left-over triggers from the previous debug session + this->clearAllBreakpoints(); + } + auto debugControlStatusRegister = this->readDebugControlStatusRegister(); debugControlStatusRegister.breakUMode = true; debugControlStatusRegister.breakSMode = true;