This commit is contained in:
Nav
2023-09-20 18:56:44 +01:00
parent be5e89456c
commit df5a141089
3 changed files with 18 additions and 24 deletions

View File

@@ -25,13 +25,6 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
throw Exception("Unexpected VContRangeStep packet size"); throw Exception("Unexpected VContRangeStep packet size");
} }
/*
* A single vCont packet can consist of multiple actions - we don't accommodate this ATM. We only focus on
* the first action in the packet.
*
* We also ignore the thread id (as it's not necessary here).
*/
const auto commandData = std::string(this->data.begin() + 7, this->data.end()); const auto commandData = std::string(this->data.begin() + 7, this->data.end());
const auto delimiterPosition = commandData.find(','); const auto delimiterPosition = commandData.find(',');
@@ -107,7 +100,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
Logger::debug( Logger::debug(
"Inspecting " + std::to_string(instructionsByAddress.size()) + " instructions within stepping range " "Inspecting " + std::to_string(instructionsByAddress.size()) + " instructions within stepping range "
"(byte addresses) 0x" + StringService::toHex(addressRange.startAddress) + " -> 0x" "(byte addresses) 0x" + StringService::toHex(addressRange.startAddress) + " -> 0x"
+ StringService::toHex(addressRange.endAddress) + ", in preparation for new range stepping session" + StringService::toHex(addressRange.endAddress) + ", in preparation for new range stepping session"
); );
for (const auto& [instructionAddress, instruction] : instructionsByAddress) { for (const auto& [instructionAddress, instruction] : instructionsByAddress) {
@@ -118,9 +111,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
*/ */
Logger::error( Logger::error(
"Failed to decode AVR8 opcode at byte address 0x" + StringService::toHex(instructionAddress) "Failed to decode AVR8 opcode at byte address 0x" + StringService::toHex(instructionAddress)
+ " - the instruction will have to be intercepted. Please enable debug logging, reproduce " + " - the instruction will have to be intercepted. Please enable debug logging, reproduce "
"this message and report as an issue via " + Services::PathService::homeDomainName() "this message and report as an issue via " + Services::PathService::homeDomainName()
+ "/report-issue" + "/report-issue"
); );
/* /*
@@ -145,7 +138,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
*/ */
Logger::debug( Logger::debug(
"Intercepting CCPF instruction (\"" + instruction->name + "\") at byte address 0x" "Intercepting CCPF instruction (\"" + instruction->name + "\") at byte address 0x"
+ StringService::toHex(instructionAddress) + StringService::toHex(instructionAddress)
); );
rangeSteppingSession.interceptedAddresses.insert(instructionAddress); rangeSteppingSession.interceptedAddresses.insert(instructionAddress);
continue; continue;
@@ -166,7 +159,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
Logger::debug( Logger::debug(
"Intercepting CCPF instruction (\"" + instruction->name + "\") with invalid destination " "Intercepting CCPF instruction (\"" + instruction->name + "\") with invalid destination "
"byte address (0x" + StringService::toHex(*destinationAddress) + "), at byte address 0x" "byte address (0x" + StringService::toHex(*destinationAddress) + "), at byte address 0x"
+ StringService::toHex(instructionAddress) + StringService::toHex(instructionAddress)
); );
rangeSteppingSession.interceptedAddresses.insert(instructionAddress); rangeSteppingSession.interceptedAddresses.insert(instructionAddress);
continue; continue;
@@ -183,8 +176,9 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
* destination address. * destination address.
*/ */
Logger::debug( Logger::debug(
"Intercepting CCPF instruction (\"" + instruction->name + "\") at destination byte address " "Intercepting destination byte address 0x" + StringService::toHex(*destinationAddress)
"0x" + StringService::toHex(*destinationAddress) + " of CCPF instruction (\"" + instruction->name + "\") at byte address 0x"
+ StringService::toHex(instructionAddress)
); );
rangeSteppingSession.interceptedAddresses.insert(*destinationAddress); rangeSteppingSession.interceptedAddresses.insert(*destinationAddress);
} }
@@ -198,7 +192,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets
*/ */
Logger::debug( Logger::debug(
"Intercepting subsequent instruction at byte address 0x" "Intercepting subsequent instruction at byte address 0x"
+ StringService::toHex(subsequentInstructionAddress) + StringService::toHex(subsequentInstructionAddress)
); );
rangeSteppingSession.interceptedAddresses.insert(subsequentInstructionAddress); rangeSteppingSession.interceptedAddresses.insert(subsequentInstructionAddress);
} }

View File

@@ -456,8 +456,8 @@ namespace TargetController
} }
void TargetControllerComponent::acquireHardware() { void TargetControllerComponent::acquireHardware() {
auto debugToolName = this->environmentConfig.debugToolConfig.name; const auto& debugToolName = this->environmentConfig.debugToolConfig.name;
auto targetName = this->environmentConfig.targetConfig.name; const auto& targetName = this->environmentConfig.targetConfig.name;
static const auto supportedDebugTools = this->getSupportedDebugTools(); static const auto supportedDebugTools = this->getSupportedDebugTools();
static const auto supportedTargets = this->getSupportedTargets(); static const auto supportedTargets = this->getSupportedTargets();

View File

@@ -25,12 +25,12 @@ namespace Targets
TargetMemoryType programMemoryType; TargetMemoryType programMemoryType;
TargetDescriptor( TargetDescriptor(
std::string id, const std::string& id,
std::string name, const std::string& name,
std::string vendorName, const std::string& vendorName,
std::map<TargetMemoryType, TargetMemoryDescriptor> memoryDescriptorsByType, const std::map<TargetMemoryType, TargetMemoryDescriptor>& memoryDescriptorsByType,
std::map<TargetRegisterDescriptorId, TargetRegisterDescriptor> registerDescriptorsById, const std::map<TargetRegisterDescriptorId, TargetRegisterDescriptor>& registerDescriptorsById,
std::vector<TargetVariant> variants, const std::vector<TargetVariant>& variants,
TargetMemoryType programMemoryType TargetMemoryType programMemoryType
) )
: name(name) : name(name)