diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp index bb90967d..2355a732 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp @@ -140,8 +140,8 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets } return { - StringService::toUint32(command.substr(0, delimiterPos), 16), - StringService::toUint32(command.substr(delimiterPos + 1), 16) + .gdbStartAddress = StringService::toUint32(command.substr(0, delimiterPos), 16), + .bytes = StringService::toUint32(command.substr(delimiterPos + 1), 16) }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp index 169275c8..6a4ca33b 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp @@ -105,12 +105,12 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets } return { - StringService::toUint32(command.substr(0, commaDelimiterPos), 16), - StringService::toUint32( + .gdbStartAddress = StringService::toUint32(command.substr(0, commaDelimiterPos), 16), + .bytes = StringService::toUint32( command.substr(commaDelimiterPos + 1, colonDelimiterPos - (commaDelimiterPos + 1)), 16 ), - StringService::dataFromHex(command.substr(colonDelimiterPos + 1)) + .buffer = StringService::dataFromHex(command.substr(colonDelimiterPos + 1)) }; } diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp index 43abe8bf..cf4f60d6 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.hpp @@ -37,7 +37,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets private: struct PacketData { - std::uint32_t gdbStartAddress; + GdbMemoryAddress gdbStartAddress; std::uint32_t bytes; Targets::TargetMemoryBuffer buffer; }; diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.hpp b/src/DebugServer/Gdb/GdbRspDebugServer.hpp index 13d6a83b..9e442954 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.hpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.hpp @@ -140,8 +140,8 @@ namespace DebugServer::Gdb }; } - auto socketFileDescriptor = int{0}; - if ((socketFileDescriptor = ::socket(AF_INET, SOCK_STREAM, 0)) == 0) { + const auto socketFileDescriptor = ::socket(AF_INET, SOCK_STREAM, 0); + if (socketFileDescriptor == 0) { throw ::Exceptions::Exception{"Failed to create socket file descriptor."}; }