Changed all bloom.yaml config keys/values to use snake_casing

This commit is contained in:
Nav
2024-11-27 20:18:00 +00:00
parent a63dd1b4ef
commit 9c1b194af1
10 changed files with 74 additions and 87 deletions

View File

@@ -24,7 +24,6 @@ enum TargetPhysicalInterface: string
self::UPDI => 'UPDI', self::UPDI => 'UPDI',
self::DEBUG_WIRE => 'debugWIRE', self::DEBUG_WIRE => 'debugWIRE',
self::SDI => 'SDI', self::SDI => 'SDI',
default => 'Other'
}; };
} }
@@ -34,7 +33,7 @@ enum TargetPhysicalInterface: string
self::JTAG => 'jtag', self::JTAG => 'jtag',
self::PDI => 'pdi', self::PDI => 'pdi',
self::UPDI => 'updi', self::UPDI => 'updi',
self::DEBUG_WIRE => 'debug-wire', self::DEBUG_WIRE => 'debug_wire',
self::SDI => 'sdi', self::SDI => 'sdi',
default => null default => null
}; };

View File

@@ -1,20 +1,20 @@
environments: environments:
default: default:
shutdownPostDebugSession: true shutdown_post_debug_session: true
tool: tool:
name: "xplained-pro" name: "xplained_pro"
target: target:
name: "atmega4809" name: "atmega4809"
physicalInterface: "updi" physical_interface: "updi"
hardwareBreakpoints: true hardware_breakpoints: true
server: server:
name: "avr-gdb-rsp" name: "avr_gdb_rsp"
ipAddress: "127.0.0.1" ip_address: "127.0.0.1"
port: 1442 port: 1442
rangeStepping: true range_stepping: true
insight: insight:
activateOnStartup: false activate_on_startup: false

View File

@@ -42,7 +42,7 @@ namespace DebugServer
> DebugServerComponent::getAvailableServersByName() { > DebugServerComponent::getAvailableServersByName() {
return std::map<std::string, std::function<std::unique_ptr<ServerInterface>()>> { return std::map<std::string, std::function<std::unique_ptr<ServerInterface>()>> {
{ {
"avr-gdb-rsp", "avr_gdb_rsp",
[this] () -> std::unique_ptr<ServerInterface> { [this] () -> std::unique_ptr<ServerInterface> {
if (this->targetDescriptor.family != Targets::TargetFamily::AVR_8) { if (this->targetDescriptor.family != Targets::TargetFamily::AVR_8) {
throw Exceptions::Exception{"The AVR GDB RSP server is only compatible with AVR8 targets."}; throw Exceptions::Exception{"The AVR GDB RSP server is only compatible with AVR8 targets."};
@@ -57,7 +57,7 @@ namespace DebugServer
} }
}, },
{ {
"riscv-gdb-rsp", "riscv_gdb_rsp",
[this] () -> std::unique_ptr<ServerInterface> { [this] () -> std::unique_ptr<ServerInterface> {
if (this->targetDescriptor.family != Targets::TargetFamily::RISC_V) { if (this->targetDescriptor.family != Targets::TargetFamily::RISC_V) {
throw Exceptions::Exception{"The RISC-V GDB RSP server is only compatible with RISC-V targets."}; throw Exceptions::Exception{"The RISC-V GDB RSP server is only compatible with RISC-V targets."};

View File

@@ -8,13 +8,13 @@ namespace DebugServer::Gdb
GdbDebugServerConfig::GdbDebugServerConfig(const DebugServerConfig& debugServerConfig) GdbDebugServerConfig::GdbDebugServerConfig(const DebugServerConfig& debugServerConfig)
: DebugServerConfig(debugServerConfig) : DebugServerConfig(debugServerConfig)
{ {
if (debugServerConfig.debugServerNode["ipAddress"]) { if (debugServerConfig.debugServerNode["ip_address"]) {
if (YamlUtilities::isCastable<std::string>(debugServerConfig.debugServerNode["ipAddress"])) { if (YamlUtilities::isCastable<std::string>(debugServerConfig.debugServerNode["ip_address"])) {
this->listeningAddress = debugServerConfig.debugServerNode["ipAddress"].as<std::string>(); this->listeningAddress = debugServerConfig.debugServerNode["ip_address"].as<std::string>();
} else { } else {
Logger::error( Logger::error(
"Invalid GDB debug server config parameter ('ipAddress') provided - must be a string. The " "Invalid GDB debug server config parameter ('ip_address') provided - must be a string. The "
"parameter will be ignored." "parameter will be ignored."
); );
} }
@@ -32,25 +32,25 @@ namespace DebugServer::Gdb
} }
} }
if (debugServerConfig.debugServerNode["rangeStepping"]) { if (debugServerConfig.debugServerNode["range_stepping"]) {
if (YamlUtilities::isCastable<bool>(debugServerConfig.debugServerNode["rangeStepping"])) { if (YamlUtilities::isCastable<bool>(debugServerConfig.debugServerNode["range_stepping"])) {
this->rangeStepping = debugServerConfig.debugServerNode["rangeStepping"].as<bool>(); this->rangeStepping = debugServerConfig.debugServerNode["range_stepping"].as<bool>();
} else { } else {
Logger::error( Logger::error(
"Invalid GDB debug server config parameter ('rangeStepping') provided - value must be castable to " "Invalid GDB debug server config parameter ('range_stepping') provided - value must be castable to "
"a boolean. The parameter will be ignored." "a boolean. The parameter will be ignored."
); );
} }
} }
if (debugServerConfig.debugServerNode["packetAcknowledgement"]) { if (debugServerConfig.debugServerNode["packet_acknowledgement"]) {
if (YamlUtilities::isCastable<bool>(debugServerConfig.debugServerNode["packetAcknowledgement"])) { if (YamlUtilities::isCastable<bool>(debugServerConfig.debugServerNode["packet_acknowledgement"])) {
this->packetAcknowledgement = debugServerConfig.debugServerNode["packetAcknowledgement"].as<bool>(); this->packetAcknowledgement = debugServerConfig.debugServerNode["packet_acknowledgement"].as<bool>();
} else { } else {
Logger::error( Logger::error(
"Invalid GDB debug server config parameter ('packetAcknowledgement') provided - value must be" "Invalid GDB debug server config parameter ('packet_acknowledgement') provided - value must be"
" castable to a boolean. The parameter will be ignored." " castable to a boolean. The parameter will be ignored."
); );
} }

View File

@@ -10,17 +10,17 @@ namespace DebugToolDrivers::Microchip
{ {
const auto& toolNode = toolConfig.toolNode; const auto& toolNode = toolConfig.toolNode;
const auto edbgDriverNode = toolNode["edbgDriver"]; const auto edbgDriverNode = toolNode["edbg_driver"];
if (edbgDriverNode) { if (edbgDriverNode) {
if (edbgDriverNode["cmsisCommandDelay"]) { if (edbgDriverNode["cmsis_command_delay"]) {
if (YamlUtilities::isCastable<std::uint16_t>(edbgDriverNode["cmsisCommandDelay"])) { if (YamlUtilities::isCastable<std::uint16_t>(edbgDriverNode["cmsis_command_delay"])) {
this->cmsisCommandDelay = std::chrono::milliseconds{ this->cmsisCommandDelay = std::chrono::milliseconds{
edbgDriverNode["cmsisCommandDelay"].as<std::uint16_t>() edbgDriverNode["cmsis_command_delay"].as<std::uint16_t>()
}; };
} else { } else {
Logger::error( Logger::error(
"Invalid EDBG driver config parameter ('cmsisCommandDelay') provided - must be a 16-bit " "Invalid EDBG driver config parameter ('cmsis_command_delay') provided - must be a 16-bit "
"unsigned integer. The parameter will be ignored." "unsigned integer. The parameter will be ignored."
); );
} }

View File

@@ -8,25 +8,25 @@
namespace DebugToolDrivers::Protocols::RiscVDebugSpec namespace DebugToolDrivers::Protocols::RiscVDebugSpec
{ {
DebugTranslatorConfig::DebugTranslatorConfig(const YAML::Node& configNode) { DebugTranslatorConfig::DebugTranslatorConfig(const YAML::Node& configNode) {
if (configNode["targetResponseTimeout"]) { if (configNode["target_response_timeout"]) {
this->targetResponseTimeout = std::chrono::microseconds{ this->targetResponseTimeout = std::chrono::microseconds{
configNode["targetResponseTimeout"].as<std::int64_t>(this->targetResponseTimeout.count()) configNode["target_response_timeout"].as<std::int64_t>(this->targetResponseTimeout.count())
}; };
} }
if (configNode["preferredMemoryAccessStrategy"]) { if (configNode["preferred_memory_access_strategy"]) {
const auto strategy = configNode["preferredMemoryAccessStrategy"].as<std::string>(); const auto strategy = configNode["preferred_memory_access_strategy"].as<std::string>();
if (strategy == "abstract-command") { if (strategy == "abstract_command") {
this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::ABSTRACT_COMMAND; this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::ABSTRACT_COMMAND;
} else if (strategy == "program-buffer") { } else if (strategy == "program_buffer") {
this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::PROGRAM_BUFFER; this->preferredMemoryAccessStrategy = DebugModule::MemoryAccessStrategy::PROGRAM_BUFFER;
} else { } else {
Logger::error( Logger::error(
"Invalid value (\"" + strategy + "\") provided for RISC-V debug translator config parameter " "Invalid value (\"" + strategy + "\") provided for RISC-V debug translator config parameter "
"('preferredMemoryAccessStrategy'). Parameter will be ignored." "('preferred_memory_access_strategy'). Parameter will be ignored."
); );
} }
} }

View File

@@ -7,9 +7,9 @@ namespace DebugToolDrivers::Wch
{ {
const auto& toolNode = toolConfig.toolNode; const auto& toolNode = toolConfig.toolNode;
if (toolNode["riscVDebugTranslator"]) { if (toolNode["riscv_debug_translator"]) {
this->riscVDebugTranslatorConfig = ::DebugToolDrivers::Protocols::RiscVDebugSpec::DebugTranslatorConfig{ this->riscVDebugTranslatorConfig = ::DebugToolDrivers::Protocols::RiscVDebugSpec::DebugTranslatorConfig{
toolNode["riscVDebugTranslator"] toolNode["riscv_debug_translator"]
}; };
} }
} }

View File

@@ -74,8 +74,8 @@ ProjectConfig::ProjectConfig(const YAML::Node& configNode) {
this->debugLogging = configNode["debugLoggingEnabled"].as<bool>(this->debugLogging); this->debugLogging = configNode["debugLoggingEnabled"].as<bool>(this->debugLogging);
} }
if (configNode["debugLogging"]) { if (configNode["debug_logging"]) {
this->debugLogging = configNode["debugLogging"].as<bool>(this->debugLogging); this->debugLogging = configNode["debug_logging"].as<bool>(this->debugLogging);
} }
} }
@@ -86,12 +86,12 @@ InsightConfig::InsightConfig(const YAML::Node& insightNode) {
}; };
} }
if (insightNode["activateOnStartup"]) { if (insightNode["activate_on_startup"]) {
this->activateOnStartup = insightNode["activateOnStartup"].as<bool>(this->activateOnStartup); this->activateOnStartup = insightNode["activate_on_startup"].as<bool>(this->activateOnStartup);
} }
if (insightNode["shutdownOnClose"]) { if (insightNode["shutdown_on_close"]) {
this->shutdownOnClose = insightNode["shutdownOnClose"].as<bool>(this->shutdownOnClose); this->shutdownOnClose = insightNode["shutdown_on_close"].as<bool>(this->shutdownOnClose);
} }
} }
@@ -143,8 +143,8 @@ EnvironmentConfig::EnvironmentConfig(std::string name, const YAML::Node& environ
this->insightConfig = InsightConfig(environmentNode["insight"]); this->insightConfig = InsightConfig(environmentNode["insight"]);
} }
if (environmentNode["shutdownPostDebugSession"]) { if (environmentNode["shutdown_post_debug_session"]) {
this->shutdownPostDebugSession = environmentNode["shutdownPostDebugSession"].as<bool>( this->shutdownPostDebugSession = environmentNode["shutdown_post_debug_session"].as<bool>(
this->shutdownPostDebugSession this->shutdownPostDebugSession
); );
} }
@@ -166,19 +166,18 @@ TargetConfig::TargetConfig(const YAML::Node& targetNode) {
this->name = StringService::asciiToLower(targetNode["name"].as<std::string>()); this->name = StringService::asciiToLower(targetNode["name"].as<std::string>());
static auto physicalInterfacesByConfigName = std::map<std::string, TargetPhysicalInterface>{ static auto physicalInterfacesByConfigName = std::map<std::string, TargetPhysicalInterface>{
{"debugwire", TargetPhysicalInterface::DEBUG_WIRE}, // Deprecated - left here for backwards compatibility {"debug_wire", TargetPhysicalInterface::DEBUG_WIRE},
{"debug-wire", TargetPhysicalInterface::DEBUG_WIRE},
{"pdi", TargetPhysicalInterface::PDI}, {"pdi", TargetPhysicalInterface::PDI},
{"jtag", TargetPhysicalInterface::JTAG}, {"jtag", TargetPhysicalInterface::JTAG},
{"updi", TargetPhysicalInterface::UPDI}, {"updi", TargetPhysicalInterface::UPDI},
{"sdi", TargetPhysicalInterface::SDI}, {"sdi", TargetPhysicalInterface::SDI},
}; };
if (!targetNode["physicalInterface"]) { if (!targetNode["physical_interface"]) {
throw Exceptions::InvalidConfig{"No physical interface specified."}; throw Exceptions::InvalidConfig{"No physical interface specified."};
} }
const auto physicalInterfaceName = StringService::asciiToLower(targetNode["physicalInterface"].as<std::string>()); const auto physicalInterfaceName = StringService::asciiToLower(targetNode["physical_interface"].as<std::string>());
const auto physicalInterfaceIt = physicalInterfacesByConfigName.find(physicalInterfaceName); const auto physicalInterfaceIt = physicalInterfacesByConfigName.find(physicalInterfaceName);
if (physicalInterfaceIt == physicalInterfacesByConfigName.end()) { if (physicalInterfaceIt == physicalInterfacesByConfigName.end()) {
@@ -195,16 +194,16 @@ TargetConfig::TargetConfig(const YAML::Node& targetNode) {
this->variantName = StringService::asciiToLower(targetNode["variantName"].as<std::string>()); this->variantName = StringService::asciiToLower(targetNode["variantName"].as<std::string>());
} }
if (targetNode["hardwareBreakpoints"]) { if (targetNode["hardware_breakpoints"]) {
this->hardwareBreakpoints = targetNode["hardwareBreakpoints"].as<bool>(this->hardwareBreakpoints); this->hardwareBreakpoints = targetNode["hardware_breakpoints"].as<bool>(this->hardwareBreakpoints);
} }
if (targetNode["programMemoryCache"]) { if (targetNode["program_memory_cache"]) {
this->programMemoryCache = targetNode["programMemoryCache"].as<bool>(this->programMemoryCache); this->programMemoryCache = targetNode["program_memory_cache"].as<bool>(this->programMemoryCache);
} }
if (targetNode["reserveSteppingBreakpoint"]) { if (targetNode["reserve_stepping_breakpoint"]) {
this->reserveSteppingBreakpoint = targetNode["reserveSteppingBreakpoint"].as<bool>(false); this->reserveSteppingBreakpoint = targetNode["reserve_stepping_breakpoint"].as<bool>(false);
} }
this->targetNode = targetNode; this->targetNode = targetNode;

View File

@@ -322,13 +322,13 @@ namespace TargetController
// The debug tool names in this mapping should always be lower-case. // The debug tool names in this mapping should always be lower-case.
return std::map<std::string, std::function<std::unique_ptr<DebugTool>()>> { return std::map<std::string, std::function<std::unique_ptr<DebugTool>()>> {
{ {
"atmel-ice", "atmel_ice",
[this] { [this] {
return std::make_unique<AtmelIce>(this->environmentConfig.debugToolConfig); return std::make_unique<AtmelIce>(this->environmentConfig.debugToolConfig);
} }
}, },
{ {
"power-debugger", "power_debugger",
[this] { [this] {
return std::make_unique<PowerDebugger>(this->environmentConfig.debugToolConfig); return std::make_unique<PowerDebugger>(this->environmentConfig.debugToolConfig);
} }
@@ -340,31 +340,31 @@ namespace TargetController
} }
}, },
{ {
"pickit-4", "pickit_4",
[this] { [this] {
return std::make_unique<MplabPickit4>(this->environmentConfig.debugToolConfig); return std::make_unique<MplabPickit4>(this->environmentConfig.debugToolConfig);
} }
}, },
{ {
"xplained-pro", "xplained_pro",
[this] { [this] {
return std::make_unique<XplainedPro>(this->environmentConfig.debugToolConfig); return std::make_unique<XplainedPro>(this->environmentConfig.debugToolConfig);
} }
}, },
{ {
"xplained-mini", "xplained_mini",
[this] { [this] {
return std::make_unique<XplainedMini>(this->environmentConfig.debugToolConfig); return std::make_unique<XplainedMini>(this->environmentConfig.debugToolConfig);
} }
}, },
{ {
"xplained-nano", "xplained_nano",
[this] { [this] {
return std::make_unique<XplainedNano>(this->environmentConfig.debugToolConfig); return std::make_unique<XplainedNano>(this->environmentConfig.debugToolConfig);
} }
}, },
{ {
"curiosity-nano", "curiosity_nano",
[this] { [this] {
return std::make_unique<CuriosityNano>(this->environmentConfig.debugToolConfig); return std::make_unique<CuriosityNano>(this->environmentConfig.debugToolConfig);
} }
@@ -376,7 +376,7 @@ namespace TargetController
} }
}, },
{ {
"wch-link-e", "wch_link_e",
[this] { [this] {
return std::make_unique<WchLinkE>(this->environmentConfig.debugToolConfig); return std::make_unique<WchLinkE>(this->environmentConfig.debugToolConfig);
} }

View File

@@ -7,47 +7,36 @@ namespace Targets::Microchip::Avr8
{ {
const auto& targetNode = targetConfig.targetNode; const auto& targetNode = targetConfig.targetNode;
// The 'manageDwenFuseBit' param used to be 'updateDwenFuseBit' - we still support the old, for now. if (targetNode["manage_dwen_fuse_bit"]) {
if (targetNode["updateDwenFuseBit"]) { this->manageDwenFuseBit = targetNode["manage_dwen_fuse_bit"].as<bool>(
this->manageDwenFuseBit = targetNode["updateDwenFuseBit"].as<bool>(
this->manageDwenFuseBit this->manageDwenFuseBit
); );
} }
if (targetNode["manageDwenFuseBit"]) { if (targetNode["cycle_target_power_post_dwen_update"]) {
this->manageDwenFuseBit = targetNode["manageDwenFuseBit"].as<bool>( this->cycleTargetPowerPostDwenUpdate = targetNode["cycle_target_power_post_dwen_update"].as<bool>(
this->manageDwenFuseBit
);
}
if (targetNode["cycleTargetPowerPostDwenUpdate"]) {
this->cycleTargetPowerPostDwenUpdate = targetNode["cycleTargetPowerPostDwenUpdate"].as<bool>(
this->cycleTargetPowerPostDwenUpdate this->cycleTargetPowerPostDwenUpdate
); );
} }
if (targetNode["disableDebugWirePreDisconnect"]) { if (targetNode["disable_debug_wire_pre_disconnect"]) {
this->disableDebugWireOnDeactivate = targetNode["disableDebugWirePreDisconnect"].as<bool>( this->disableDebugWireOnDeactivate = targetNode["disable_debug_wire_pre_disconnect"].as<bool>(
this->disableDebugWireOnDeactivate this->disableDebugWireOnDeactivate
); );
} }
if (targetNode["targetPowerCycleDelay"]) { if (targetNode["target_power_cycle_delay"]) {
this->targetPowerCycleDelay = std::chrono::milliseconds{targetNode["targetPowerCycleDelay"].as<int>( this->targetPowerCycleDelay = std::chrono::milliseconds{targetNode["target_power_cycle_delay"].as<int>(
this->targetPowerCycleDelay.count() this->targetPowerCycleDelay.count()
)}; )};
} }
if (targetNode["manageOcdenFuseBit"]) { if (targetNode["manage_ocden_fuse_bit"]) {
this->manageOcdenFuseBit = targetNode["manageOcdenFuseBit"].as<bool>( this->manageOcdenFuseBit = targetNode["manage_ocden_fuse_bit"].as<bool>(this->manageOcdenFuseBit);
this->manageOcdenFuseBit
);
} }
if (targetNode["preserveEeprom"]) { if (targetNode["preserve_eeprom"]) {
this->preserveEeprom = targetNode["preserveEeprom"].as<bool>( this->preserveEeprom = targetNode["preserve_eeprom"].as<bool>(this->preserveEeprom);
this->preserveEeprom
);
} }
} }
} }