2022-03-19 15:15:36 +00:00
|
|
|
#include "GdbDebugServerConfig.hpp"
|
|
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
#include "src/Helpers/YamlUtilities.hpp"
|
|
|
|
|
#include "src/Logger/Logger.hpp"
|
|
|
|
|
|
2022-03-31 16:05:39 +01:00
|
|
|
namespace Bloom::DebugServer::Gdb
|
2022-03-19 15:15:36 +00:00
|
|
|
{
|
|
|
|
|
GdbDebugServerConfig::GdbDebugServerConfig(const DebugServerConfig& debugServerConfig)
|
|
|
|
|
: DebugServerConfig(debugServerConfig)
|
|
|
|
|
{
|
2022-07-23 15:37:22 +01:00
|
|
|
if (debugServerConfig.debugServerNode["ipAddress"]) {
|
|
|
|
|
if (!YamlUtilities::isType<std::string>(debugServerConfig.debugServerNode["ipAddress"])) {
|
|
|
|
|
Logger::error(
|
|
|
|
|
"Invalid GDB debug server config parameter ('ipAddress') provided - must be a string. The "
|
|
|
|
|
"parameter will be ignored."
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->listeningAddress = debugServerConfig.debugServerNode["ipAddress"].as<std::string>();
|
2022-03-19 15:15:36 +00:00
|
|
|
}
|
|
|
|
|
|
2022-07-23 15:37:22 +01:00
|
|
|
if (debugServerConfig.debugServerNode["port"]) {
|
2022-03-19 15:15:36 +00:00
|
|
|
this->listeningPortNumber = static_cast<std::uint16_t>(
|
2022-07-23 15:37:22 +01:00
|
|
|
debugServerConfig.debugServerNode["port"].as<int>()
|
2022-03-19 15:15:36 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|