diff --git a/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp b/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp index 02fbd313..9b15a8d9 100644 --- a/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp +++ b/src/DebugServer/Gdb/CommandPackets/ResetTarget.cpp @@ -27,6 +27,8 @@ namespace DebugServer::Gdb::CommandPackets const Targets::TargetDescriptor&, TargetControllerService& targetControllerService ) { + using Services::StringService; + Logger::info("Handling ResetTarget packet"); try { @@ -36,7 +38,12 @@ namespace DebugServer::Gdb::CommandPackets debugSession.connection.writePacket(ResponsePacket{Services::StringService::toHex( "Target reset complete\n" - "Current PC: 0x" + Services::StringService::toHex(targetControllerService.getProgramCounter()) + "\n" + "Current PC: " + StringService::applyTerminalColor( + "0x" + StringService::asciiToUpper( + StringService::toHex(targetControllerService.getProgramCounter()) + ), + StringService::TerminalColor::BLUE + ) + "\n" "Use the 'continue' command to begin execution\n" )}); diff --git a/src/DebugToolDrivers/WCH/WchLinkDebugInterface.cpp b/src/DebugToolDrivers/WCH/WchLinkDebugInterface.cpp index d6eb2ea2..34224d1e 100644 --- a/src/DebugToolDrivers/WCH/WchLinkDebugInterface.cpp +++ b/src/DebugToolDrivers/WCH/WchLinkDebugInterface.cpp @@ -57,7 +57,7 @@ namespace DebugToolDrivers::Wch this->targetConfig } ) - , programSegmentDescriptor( + , mainProgramSegmentDescriptor( this->targetDescriptionFile.getSystemAddressSpaceDescriptor().getMemorySegmentDescriptor("main_program") ) , flashProgramOpcodes( @@ -80,7 +80,7 @@ namespace DebugToolDrivers::Wch auto response = this->wchLinkInterface.sendCommandAndWaitForResponse(Commands::Control::AttachTarget{}); if (response.payload.size() != 5) { - throw Exceptions::DeviceCommunicationFailure{"Unexpected response payload size for AttachTarget command"}; + throw DeviceCommunicationFailure{"Unexpected response payload size for AttachTarget command"}; } this->cachedTargetId = response.payload[0]; @@ -112,7 +112,7 @@ namespace DebugToolDrivers::Wch response = this->wchLinkInterface.sendCommandAndWaitForResponse(Commands::Control::AttachTarget{}); if (response.payload.size() != 5) { - throw Exceptions::DeviceCommunicationFailure{ + throw DeviceCommunicationFailure{ "Unexpected response payload size for subsequent AttachTarget command" }; } @@ -132,7 +132,7 @@ namespace DebugToolDrivers::Wch const auto response = this->wchLinkInterface.sendCommandAndWaitForResponse(Commands::Control::DetachTarget{}); if (response.payload.size() != 1) { - throw Exceptions::DeviceCommunicationFailure{"Unexpected response payload size for DetachTarget command"}; + throw DeviceCommunicationFailure{"Unexpected response payload size for DetachTarget command"}; } } @@ -272,7 +272,7 @@ namespace DebugToolDrivers::Wch const auto commandError = this->riscVTranslator.readAndClearAbstractCommandError(); if (commandError != DebugModule::AbstractCommandError::NONE) { - throw Exceptions::Exception{ + throw Exception{ "Partial block write failed - abstract command error: 0x" + Services::StringService::toHex(commandError) }; @@ -359,7 +359,7 @@ namespace DebugToolDrivers::Wch const TargetAddressSpaceDescriptor& addressSpaceDescriptor, const TargetMemorySegmentDescriptor& memorySegmentDescriptor ) { - if (memorySegmentDescriptor == this->programSegmentDescriptor) { + if (memorySegmentDescriptor == this->mainProgramSegmentDescriptor) { return this->wchLinkInterface.eraseProgramMemory(); } diff --git a/src/DebugToolDrivers/WCH/WchLinkDebugInterface.hpp b/src/DebugToolDrivers/WCH/WchLinkDebugInterface.hpp index a3c0228c..b6af89c0 100644 --- a/src/DebugToolDrivers/WCH/WchLinkDebugInterface.hpp +++ b/src/DebugToolDrivers/WCH/WchLinkDebugInterface.hpp @@ -89,7 +89,7 @@ namespace DebugToolDrivers::Wch Protocols::WchLink::WchLinkInterface& wchLinkInterface; DebugToolDrivers::Protocols::RiscVDebugSpec::DebugTranslator riscVTranslator; - const Targets::TargetMemorySegmentDescriptor& programSegmentDescriptor; + const Targets::TargetMemorySegmentDescriptor& mainProgramSegmentDescriptor; /** * The 'target activation' command returns a payload of 5 bytes. diff --git a/src/TargetController/TargetControllerComponent.cpp b/src/TargetController/TargetControllerComponent.cpp index 947254f0..da8c5165 100644 --- a/src/TargetController/TargetControllerComponent.cpp +++ b/src/TargetController/TargetControllerComponent.cpp @@ -81,7 +81,7 @@ namespace TargetController while (this->getThreadState() == ThreadState::READY) { this->refreshExecutionState(); - TargetControllerComponent::notifier.waitForNotification(std::chrono::milliseconds(60 )); + TargetControllerComponent::notifier.waitForNotification(std::chrono::milliseconds{60}); this->processQueuedCommands(); this->eventListener->dispatchCurrentEvents();