From 4348a6d88cf3d2f2a7864d65ef4bd93409f0e84d Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 11 Sep 2023 16:57:14 +0100 Subject: [PATCH] Corrected handling of empty address range in range step GDB command --- src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp index 4b6e80ae..71eccb46 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp @@ -72,7 +72,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets ).addressRange; if ( - this->startAddress >= this->endAddress + this->startAddress > this->endAddress || (this->startAddress % 2) != 0 || (this->endAddress % 2) != 0 || this->startAddress < programMemoryAddressRange.startAddress @@ -88,7 +88,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets 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. targetControllerService.stepTargetExecution(std::nullopt); debugSession.waitingForBreak = true;