From a6d79e4680f19c30054fc167b31d0e17ef887e6f Mon Sep 17 00:00:00 2001 From: Nav Date: Wed, 28 Aug 2024 19:02:23 +0100 Subject: [PATCH] Accept `0x` prefix in `eeprom fill` GDB monitor command --- src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp index 7f556d7f..6e53daf3 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/EepromFill.cpp @@ -43,7 +43,14 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets } const auto eepromSize = this->eepromMemorySegmentDescriptor.size(); - const auto& fillValue = Services::StringService::dataFromHex(this->commandArguments[2]); + const auto& rawFillValue = this->commandArguments[2]; + + const auto fillValue = Services::StringService::dataFromHex( + rawFillValue.size() >= 3 && rawFillValue[0] == '0' + && (rawFillValue[1] == 'X' || rawFillValue[1] == 'x') + ? rawFillValue.substr(2) + : rawFillValue + ); const auto fillValueSize = fillValue.size(); if (fillValueSize > eepromSize) {