diff --git a/src/DebugServers/GdbRsp/Connection.cpp b/src/DebugServers/GdbRsp/Connection.cpp index b8b878dc..bfac3bb7 100644 --- a/src/DebugServers/GdbRsp/Connection.cpp +++ b/src/DebugServers/GdbRsp/Connection.cpp @@ -108,7 +108,7 @@ namespace Bloom::DebugServers::Gdb auto output = std::vector(); constexpr size_t bufferSize = 1024; std::array buffer = {}; - ssize_t bytesRead; + ssize_t bytesRead = 0; if (interruptible) { if (this->readInterruptEnabled != interruptible) { @@ -145,8 +145,10 @@ namespace Bloom::DebugServers::Gdb } size_t bytesToRead = (bytes > bufferSize || bytes == 0) ? bufferSize : bytes; - while (bytesToRead > 0 - && (bytesRead = ::read(this->socketFileDescriptor, buffer.data(), bytesToRead)) > 0) { + while ( + bytesToRead > 0 + && (bytesRead = ::read(this->socketFileDescriptor, buffer.data(), bytesToRead)) > 0 + ) { output.insert(output.end(), buffer.begin(), buffer.begin() + bytesRead); if (bytesRead < bytesToRead) { diff --git a/src/DebugServers/GdbRsp/Connection.hpp b/src/DebugServers/GdbRsp/Connection.hpp index 7bf11305..90595605 100644 --- a/src/DebugServers/GdbRsp/Connection.hpp +++ b/src/DebugServers/GdbRsp/Connection.hpp @@ -23,6 +23,7 @@ namespace Bloom::DebugServers::Gdb class Connection { public: + Connection() = delete; explicit Connection(EventNotifier& interruptEventNotifier) : interruptEventNotifier(interruptEventNotifier) @@ -103,7 +104,11 @@ namespace Bloom::DebugServers::Gdb * * @return */ - std::vector read(std::size_t bytes = 0, bool interruptible = true, std::optional msTimeout = std::nullopt); + std::vector read( + std::size_t bytes = 0, + bool interruptible = true, + std::optional msTimeout = std::nullopt + ); /** * Does the same as Connection::read(), but only reads a single byte. diff --git a/src/DebugServers/GdbRsp/DebugSession.hpp b/src/DebugServers/GdbRsp/DebugSession.hpp index 4ef285ef..41f7ed2d 100644 --- a/src/DebugServers/GdbRsp/DebugSession.hpp +++ b/src/DebugServers/GdbRsp/DebugSession.hpp @@ -2,8 +2,8 @@ #include -#include "Connection.hpp" #include "TargetDescriptor.hpp" +#include "Connection.hpp" namespace Bloom::DebugServers::Gdb { diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/GetParameter.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/GetParameter.hpp index 3290c509..51c585cc 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/GetParameter.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/EDBGControl/GetParameter.hpp @@ -11,12 +11,12 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::CommandFrames public: explicit GetParameter(const EdbgParameter& parameter) { /* - * The EDBG Get Parameter command consists of 6 bytes: + * The EDBG Get Parameter command consists of 5 bytes: * * 1. Command ID (0x02) * 2. Version (0x00) * 3. Parameter context - * 4. Parameter + * 4. Parameter ID * 5. Parameter size */ this->payload = {