Corrected handling of empty address range in range step GDB command

This commit is contained in:
Nav
2023-09-11 16:57:14 +01:00
parent 008f5bb62e
commit 4348a6d88c

View File

@@ -72,7 +72,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
).addressRange; ).addressRange;
if ( if (
this->startAddress >= this->endAddress this->startAddress > this->endAddress
|| (this->startAddress % 2) != 0 || (this->startAddress % 2) != 0
|| (this->endAddress % 2) != 0 || (this->endAddress % 2) != 0
|| this->startAddress < programMemoryAddressRange.startAddress || this->startAddress < programMemoryAddressRange.startAddress
@@ -88,7 +88,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
debugSession.terminateRangeSteppingSession(targetControllerService); debugSession.terminateRangeSteppingSession(targetControllerService);
} }
if ((this->endAddress - this->startAddress) == 2) { if (this->startAddress == this->endAddress || (this->endAddress - this->startAddress) == 2) {
// Single step requested. No need for a range step here. // Single step requested. No need for a range step here.
targetControllerService.stepTargetExecution(std::nullopt); targetControllerService.stepTargetExecution(std::nullopt);
debugSession.waitingForBreak = true; debugSession.waitingForBreak = true;