Made default value of reserveSteppingBreakpoint target config param vary across targets

This commit is contained in:
Nav
2024-11-24 19:33:28 +00:00
parent 7c647caa67
commit 899cbc92c4
4 changed files with 4 additions and 6 deletions

View File

@@ -204,9 +204,7 @@ TargetConfig::TargetConfig(const YAML::Node& targetNode) {
} }
if (targetNode["reserveSteppingBreakpoint"]) { if (targetNode["reserveSteppingBreakpoint"]) {
this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as<bool>( this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as<bool>(false);
this->reserveSteppingBreakpoint
);
} }
this->targetNode = targetNode; this->targetNode = targetNode;

View File

@@ -72,7 +72,7 @@ struct TargetConfig
/** /**
* Determines if Bloom will reserve a single hardware breakpoint for stepping operations. * Determines if Bloom will reserve a single hardware breakpoint for stepping operations.
*/ */
bool reserveSteppingBreakpoint = true; std::optional<bool> reserveSteppingBreakpoint = std::nullopt;
/** /**
* For extracting any target specific configuration. See Avr8TargetConfig::Avr8TargetConfig() and * For extracting any target specific configuration. See Avr8TargetConfig::Avr8TargetConfig() and

View File

@@ -819,7 +819,7 @@ namespace Targets::Microchip::Avr8
maxHardwareBreakpoints, maxHardwareBreakpoints,
std::nullopt, std::nullopt,
std::min( std::min(
static_cast<std::uint16_t>(this->targetConfig.reserveSteppingBreakpoint ? 1 : 0), static_cast<std::uint16_t>(this->targetConfig.reserveSteppingBreakpoint.value_or(true) ? 1 : 0),
maxHardwareBreakpoints maxHardwareBreakpoints
) )
}; };

View File

@@ -65,7 +65,7 @@ namespace Targets::RiscV::Wch
hardwareBreakpointCount, hardwareBreakpointCount,
std::nullopt, std::nullopt,
static_cast<std::uint16_t>( static_cast<std::uint16_t>(
this->targetConfig.reserveSteppingBreakpoint && hardwareBreakpointCount > 0 ? 1 : 0 this->targetConfig.reserveSteppingBreakpoint.value_or(false) && hardwareBreakpointCount > 0 ? 1 : 0
) )
} }
}; };