Validation for GDB port config param

This commit is contained in:
Nav
2022-09-17 00:06:02 +01:00
parent c9608f835e
commit c32cd03872

View File

@@ -20,9 +20,15 @@ namespace Bloom::DebugServer::Gdb
} }
if (debugServerConfig.debugServerNode["port"]) { if (debugServerConfig.debugServerNode["port"]) {
this->listeningPortNumber = static_cast<std::uint16_t>( if (YamlUtilities::isType<std::uint16_t>(debugServerConfig.debugServerNode["port"])) {
debugServerConfig.debugServerNode["port"].as<int>() this->listeningPortNumber = debugServerConfig.debugServerNode["port"].as<std::uint16_t>();
);
} else {
Logger::error(
"Invalid GDB debug server config parameter ('port') provided - value must be castable to a 16-bit "
"unsigned integer. The parameter will be ignored."
);
}
} }
} }
} }