Tidying
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Targets::Microchip::Avr8
|
||||
&& this->targetConfig.physicalInterface != TargetPhysicalInterface::JTAG
|
||||
) {
|
||||
Logger::warning(
|
||||
"The 'manageOcdenFuseBit' parameter only applies to JTAG targets. It will be ignored in this session."
|
||||
"The 'manage_ocden_fuse_bit' parameter only applies to JTAG targets. It will be ignored in this session."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "src/Exceptions/InvalidConfig.hpp"
|
||||
#include "src/Exceptions/Exception.hpp"
|
||||
|
||||
#include "src/Services/StringService.hpp"
|
||||
#include "src/Logger/Logger.hpp"
|
||||
|
||||
namespace Targets::RiscV::Wch
|
||||
@@ -256,6 +257,8 @@ namespace Targets::RiscV::Wch
|
||||
}
|
||||
|
||||
TargetMemoryAddress WchRiscV::getProgramCounter() {
|
||||
using Services::StringService;
|
||||
|
||||
const auto programCounter = RiscV::getProgramCounter();
|
||||
|
||||
if (this->mappedSegmentDescriptor.addressRange.contains(programCounter)) {
|
||||
@@ -283,12 +286,14 @@ namespace Targets::RiscV::Wch
|
||||
* aliased address. That way, it will be clear to all external entities, that the target is currently
|
||||
* executing code in a different memory segment to the one that was selected for debugging.
|
||||
*/
|
||||
const auto transformedAddress = this->transformMappedAddress(programCounter, actualAliasedSegment);
|
||||
Logger::warning(
|
||||
"The mapped program memory segment is currently aliasing a foreign segment (\""
|
||||
+ actualAliasedSegment.key + "\") - the program counter will be transformed to its aliased"
|
||||
" address"
|
||||
+ actualAliasedSegment.key + "\") - the program counter (0x"
|
||||
+ StringService::toHex(programCounter) + ") has been transformed to the aliased address (0x"
|
||||
+ StringService::toHex(transformedAddress) + ")"
|
||||
);
|
||||
return this->transformMappedAddress(programCounter, actualAliasedSegment);
|
||||
return transformedAddress;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user