Improved RAII of DebugSession class

This commit is contained in:
Nav
2022-08-13 03:06:30 +01:00
parent d59c4f92ba
commit 2372b93e11
5 changed files with 26 additions and 37 deletions

View File

@@ -1,6 +1,7 @@
#include "DebugSession.hpp"
#include "src/Logger/Logger.hpp"
#include "src/EventManager/EventManager.hpp"
namespace Bloom::DebugServer::Gdb
{
@@ -16,9 +17,11 @@ namespace Bloom::DebugServer::Gdb
this->supportedFeatures.insert({
Feature::PACKET_SIZE, std::to_string(this->connection.getMaxPacketSize())
});
EventManager::triggerEvent(std::make_shared<Events::DebugSessionStarted>());
}
void DebugSession::terminate() {
DebugSession::~DebugSession() {
EventManager::triggerEvent(std::make_shared<Events::DebugSessionFinished>());
}
}