Created new ServerInterface class and refactored the AVR GDB RSP debug server into an implementation of ServerInterface

This commit is contained in:
Nav
2022-03-27 18:32:13 +01:00
parent 5d3211dc68
commit 934c4b2820
9 changed files with 159 additions and 132 deletions

View File

@@ -390,15 +390,9 @@ namespace Bloom
}
void Application::startDebugServer() {
auto supportedDebugServers = this->getSupportedDebugServers();
if (!supportedDebugServers.contains(this->debugServerConfig->name)) {
throw Exceptions::InvalidConfig(
"DebugServer \"" + this->debugServerConfig->name + "\" not found."
);
}
this->debugServer = supportedDebugServers.at(this->debugServerConfig->name)();
Logger::info("Selected DebugServer: " + this->debugServer->getName());
this->debugServer = std::make_unique<DebugServers::DebugServer>(
this->debugServerConfig.value()
);
this->debugServerThread = std::thread(
&DebugServers::DebugServer::run,
@@ -414,7 +408,6 @@ namespace Bloom
void Application::stopDebugServer() {
if (this->debugServer == nullptr) {
// DebugServer hasn't been resolved yet.
return;
}