diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp index 401897a4..2fa47881 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadMemory.cpp @@ -78,6 +78,11 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets const auto& memoryDescriptor = memoryDescriptorIt->second; + if (this->memoryType == Targets::TargetMemoryType::EEPROM) { + // GDB sends EEPROM addresses in relative form - we convert them to absolute form, here. + this->startAddress = memoryDescriptor.addressRange.startAddress + this->startAddress; + } + /* * In AVR targets, RAM is mapped to many registers and peripherals - we don't want to block GDB from * accessing them. diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp index b446c3f6..e473692a 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteMemory.cpp @@ -101,6 +101,11 @@ namespace Bloom::DebugServer::Gdb::AvrGdb::CommandPackets const auto& memoryDescriptor = memoryDescriptorIt->second; + if (this->memoryType == Targets::TargetMemoryType::EEPROM) { + // GDB sends EEPROM addresses in relative form - we convert them to absolute form, here. + this->startAddress = memoryDescriptor.addressRange.startAddress + this->startAddress; + } + /* * In AVR targets, RAM is mapped to many registers and peripherals - we don't want to block GDB from * accessing them.