diff --git a/src/ProjectConfig.cpp b/src/ProjectConfig.cpp index 485ae767..3be4cfe4 100644 --- a/src/ProjectConfig.cpp +++ b/src/ProjectConfig.cpp @@ -204,9 +204,7 @@ TargetConfig::TargetConfig(const YAML::Node& targetNode) { } if (targetNode["reserveSteppingBreakpoint"]) { - this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as( - this->reserveSteppingBreakpoint - ); + this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as(false); } this->targetNode = targetNode; diff --git a/src/ProjectConfig.hpp b/src/ProjectConfig.hpp index a66693a4..bda75a61 100644 --- a/src/ProjectConfig.hpp +++ b/src/ProjectConfig.hpp @@ -72,7 +72,7 @@ struct TargetConfig /** * Determines if Bloom will reserve a single hardware breakpoint for stepping operations. */ - bool reserveSteppingBreakpoint = true; + std::optional reserveSteppingBreakpoint = std::nullopt; /** * For extracting any target specific configuration. See Avr8TargetConfig::Avr8TargetConfig() and diff --git a/src/Targets/Microchip/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR8/Avr8.cpp index 037237c0..11f8547b 100644 --- a/src/Targets/Microchip/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR8/Avr8.cpp @@ -819,7 +819,7 @@ namespace Targets::Microchip::Avr8 maxHardwareBreakpoints, std::nullopt, std::min( - static_cast(this->targetConfig.reserveSteppingBreakpoint ? 1 : 0), + static_cast(this->targetConfig.reserveSteppingBreakpoint.value_or(true) ? 1 : 0), maxHardwareBreakpoints ) }; diff --git a/src/Targets/RiscV/Wch/WchRiscV.cpp b/src/Targets/RiscV/Wch/WchRiscV.cpp index ff9dfdb9..6383d6f0 100644 --- a/src/Targets/RiscV/Wch/WchRiscV.cpp +++ b/src/Targets/RiscV/Wch/WchRiscV.cpp @@ -65,7 +65,7 @@ namespace Targets::RiscV::Wch hardwareBreakpointCount, std::nullopt, static_cast( - this->targetConfig.reserveSteppingBreakpoint && hardwareBreakpointCount > 0 ? 1 : 0 + this->targetConfig.reserveSteppingBreakpoint.value_or(false) && hardwareBreakpointCount > 0 ? 1 : 0 ) } };