This commit is contained in:
Nav
2024-12-14 16:17:54 +00:00
parent 48a7ae5dd0
commit 9e5d69dee4
5 changed files with 20 additions and 15 deletions

View File

@@ -156,17 +156,17 @@ namespace DebugServer::Gdb::AvrGdb
return output;
}
void AvrGdbRsp::handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) {
void AvrGdbRsp::handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programCounter) {
using Services::StringService;
Logger::debug("Target stopped at byte address: 0x" + StringService::toHex(programAddress));
Logger::debug("Target stopped at byte address: 0x" + StringService::toHex(programCounter));
auto& activeRangeSteppingSession = this->debugSession->activeRangeSteppingSession;
if (
activeRangeSteppingSession.has_value()
&& programAddress >= activeRangeSteppingSession->range.startAddress
&& programAddress < activeRangeSteppingSession->range.endAddress
&& programCounter >= activeRangeSteppingSession->range.startAddress
&& programCounter < activeRangeSteppingSession->range.endAddress
) {
/*
* The target stopped within the stepping range of an active range stepping session.
@@ -176,7 +176,7 @@ namespace DebugServer::Gdb::AvrGdb
if (
this->debugSession->externalBreakpointRegistry.contains(
activeRangeSteppingSession->addressSpaceDescriptor.id,
programAddress
programCounter
)
) {
/*
@@ -187,10 +187,10 @@ namespace DebugServer::Gdb::AvrGdb
Logger::debug("Reached external breakpoint within stepping range");
this->debugSession->terminateRangeSteppingSession(this->targetControllerService);
return GdbRspDebugServer::handleTargetStoppedGdbResponse(programAddress);
return GdbRspDebugServer::handleTargetStoppedGdbResponse(programCounter);
}
if (activeRangeSteppingSession->interceptedAddresses.contains(programAddress)) {
if (activeRangeSteppingSession->interceptedAddresses.contains(programCounter)) {
/*
* The target stopped due to an intercepting breakpoint, but we're still within the stepping range,
* which can only mean that we weren't sure where this instruction would lead to.
@@ -199,7 +199,7 @@ namespace DebugServer::Gdb::AvrGdb
* range, we'll end the session and report back to GDB.
*/
Logger::debug("Reached intercepting breakpoint within stepping range");
Logger::debug("Attempting single step from 0x" + StringService::toHex(programAddress));
Logger::debug("Attempting single step from 0x" + StringService::toHex(programCounter));
activeRangeSteppingSession->singleStepping = true;
this->targetControllerService.stepTargetExecution();
@@ -232,6 +232,6 @@ namespace DebugServer::Gdb::AvrGdb
}
// Report the stop to GDB
return GdbRspDebugServer::handleTargetStoppedGdbResponse(programAddress);
return GdbRspDebugServer::handleTargetStoppedGdbResponse(programCounter);
}
}

View File

@@ -27,6 +27,6 @@ namespace DebugServer::Gdb::AvrGdb
const RawPacket& rawPacket
) override;
std::set<std::pair<Feature, std::optional<std::string>>> getSupportedFeatures() override;
void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) override;
void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programCounter) override;
};
}

View File

@@ -573,7 +573,7 @@ namespace DebugServer::Gdb
}
}
virtual void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) {
virtual void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programCounter) {
if (this->debugSession->activeRangeSteppingSession.has_value()) {
this->debugSession->terminateRangeSteppingSession(this->targetControllerService);
}