Added sense-check in readMemory() in EDBG driver, to check if the EDBG debug tool actually returned data in response to memory read command

This commit is contained in:
Nav
2022-12-11 23:38:23 +00:00
parent f0225dba88
commit a792115781

View File

@@ -1794,7 +1794,13 @@ namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr
throw Avr8CommandFailure("AVR8 Read memory command failed", responseFrame);
}
return responseFrame.getMemoryBuffer();
const auto data = responseFrame.getMemoryBuffer();
if (data.size() != bytes) {
throw Avr8CommandFailure("Unexpected number of bytes returned from EDBG debug tool");
}
return data;
}
void EdbgAvr8Interface::writeMemory(