New GdbDebugServerConfig class, for GDB specific config parameters
This commit is contained in:
19
src/DebugServers/GdbRsp/GdbDebugServerConfig.cpp
Normal file
19
src/DebugServers/GdbRsp/GdbDebugServerConfig.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "GdbDebugServerConfig.hpp"
|
||||
|
||||
namespace Bloom::DebugServers::Gdb
|
||||
{
|
||||
GdbDebugServerConfig::GdbDebugServerConfig(const DebugServerConfig& debugServerConfig)
|
||||
: DebugServerConfig(debugServerConfig)
|
||||
{
|
||||
if (debugServerConfig.jsonObject.contains("ipAddress")) {
|
||||
this->listeningAddress = debugServerConfig.jsonObject.value("ipAddress").toString().toStdString();
|
||||
}
|
||||
|
||||
if (debugServerConfig.jsonObject.contains("port")) {
|
||||
const auto portValue = debugServerConfig.jsonObject.value("port");
|
||||
this->listeningPortNumber = static_cast<std::uint16_t>(
|
||||
portValue.isString() ? portValue.toString().toInt(nullptr, 10) : portValue.toInt()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user