Accept 0x prefix in eeprom fill GDB monitor command

This commit is contained in:
Nav
2024-08-28 19:02:23 +01:00
parent 3b91b99fe3
commit a6d79e4680

View File

@@ -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) {