This commit is contained in:
Nav
2024-10-19 23:11:22 +01:00
parent 7a54632966
commit a65be393be
6 changed files with 93 additions and 66 deletions

View File

@@ -207,7 +207,7 @@ namespace DebugServer::Gdb
bool interruptible,
std::optional<std::chrono::milliseconds> timeout
) {
auto output = std::vector<unsigned char>();
auto output = std::vector<unsigned char>{};
if (this->readInterruptEnabled != interruptible) {
if (interruptible) {

View File

@@ -13,8 +13,8 @@
#include "src/Helpers/EventFdNotifier.hpp"
#include "src/Helpers/EpollInstance.hpp"
#include "src/DebugServer/Gdb/Packet.hpp"
#include "src/DebugServer/Gdb/ResponsePackets/ResponsePacket.hpp"
#include "Packet.hpp"
#include "ResponsePackets/ResponsePacket.hpp"
namespace DebugServer::Gdb
{

View File

@@ -159,15 +159,17 @@ namespace DebugServer::Gdb
}
const auto commandPacket = this->waitForCommandPacket();
if (commandPacket) {
commandPacket->handle(
*(this->getActiveDebugSession()),
this->getGdbTargetDescriptor(),
this->targetDescriptor,
this->targetControllerService
);
if (!commandPacket) {
return;
}
commandPacket->handle(
*(this->getActiveDebugSession()),
this->getGdbTargetDescriptor(),
this->targetDescriptor,
this->targetControllerService
);
} catch (const ClientDisconnected&) {
Logger::info("GDB RSP client disconnected");
this->endDebugSession();