Tidied GDB debug logging
This commit is contained in:
@@ -122,7 +122,9 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
// Acknowledge receipt
|
// Acknowledge receipt
|
||||||
this->write({'+'});
|
this->write({'+'});
|
||||||
|
|
||||||
output.push_back(rawPacket);
|
Logger::debug("Read GDB packet: " + std::string(rawPacket.begin(), rawPacket.end()));
|
||||||
|
|
||||||
|
output.emplace_back(std::move(rawPacket));
|
||||||
byteIndex = packetIndex;
|
byteIndex = packetIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -134,7 +136,9 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
void Connection::writePacket(const ResponsePacket& packet) {
|
void Connection::writePacket(const ResponsePacket& packet) {
|
||||||
// Write the packet repeatedly until the GDB client acknowledges it.
|
// Write the packet repeatedly until the GDB client acknowledges it.
|
||||||
int attempts = 0;
|
int attempts = 0;
|
||||||
auto rawPacket = packet.toRawPacket();
|
const auto rawPacket = packet.toRawPacket();
|
||||||
|
|
||||||
|
Logger::debug("Writing GDB packet: " + std::string(rawPacket.begin(), rawPacket.end()));
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (attempts > 10) {
|
if (attempts > 10) {
|
||||||
@@ -239,7 +243,6 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Connection::write(const std::vector<unsigned char>& buffer) {
|
void Connection::write(const std::vector<unsigned char>& buffer) {
|
||||||
Logger::debug("Writing packet: " + std::string(buffer.begin(), buffer.end()));
|
|
||||||
if (::write(this->socketFileDescriptor.value(), buffer.data(), buffer.size()) == -1) {
|
if (::write(this->socketFileDescriptor.value(), buffer.data(), buffer.size()) == -1) {
|
||||||
if (errno == EPIPE || errno == ECONNRESET) {
|
if (errno == EPIPE || errno == ECONNRESET) {
|
||||||
// Connection was closed
|
// Connection was closed
|
||||||
|
|||||||
Reference in New Issue
Block a user