Catch errors when handling unexpected target resets in RiscV driver
This commit is contained in:
@@ -179,6 +179,7 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
||||
if (statusRegister.anyHaveReset) {
|
||||
Logger::warning("Reset detected at RISC-V hart " + std::to_string(this->selectedHartIndex));
|
||||
|
||||
try {
|
||||
if (statusRegister.anyRunning) {
|
||||
this->stop();
|
||||
}
|
||||
@@ -193,6 +194,10 @@ namespace DebugToolDrivers::Protocols::RiscVDebugSpec
|
||||
if (statusRegister.anyRunning) {
|
||||
this->run();
|
||||
}
|
||||
|
||||
} catch (const Exceptions::TargetOperationFailure& exception) {
|
||||
Logger::error("Failed to handle unexpected RISC-V hart reset - error: " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return statusRegister.anyRunning
|
||||
|
||||
Reference in New Issue
Block a user