From b5df37ae9b0aaa56dddcc123ee3d53c6a5dd1943 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 21 Sep 2023 00:40:30 +0100 Subject: [PATCH] Removed `TargetProgramCounter` type alias --- src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp | 2 +- src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp | 2 +- .../Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp | 2 +- .../Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp | 4 ++-- .../Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp | 4 ++-- .../Gdb/AvrGdb/CommandPackets/WriteRegister.cpp | 2 +- .../Gdb/CommandPackets/ContinueExecution.cpp | 2 +- src/DebugServer/Gdb/CommandPackets/StepExecution.cpp | 2 +- src/DebugServer/Gdb/GdbRspDebugServer.cpp | 2 +- src/DebugServer/Gdb/GdbRspDebugServer.hpp | 2 +- .../VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp | 5 ++--- .../VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp | 4 ++-- .../ResponseFrames/AVR8Generic/GetProgramCounter.hpp | 4 ++-- .../Microchip/AVR/AVR8/Avr8DebugInterface.hpp | 4 ++-- src/EventManager/Events/TargetExecutionStopped.hpp | 4 ++-- .../InsightWorker/Tasks/ReadProgramCounter.hpp | 2 +- .../UserInterfaces/InsightWindow/InsightWindow.cpp | 2 +- .../TargetMemoryInspectionPane/MemorySnapshot.cpp | 4 ++-- .../TargetMemoryInspectionPane/MemorySnapshot.hpp | 4 ++-- src/Services/TargetControllerService.cpp | 5 ++--- src/Services/TargetControllerService.hpp | 4 ++-- .../Commands/SetTargetProgramCounter.hpp | 4 ++-- .../Commands/StepTargetExecution.hpp | 4 ++-- .../Responses/TargetProgramCounter.hpp | 4 ++-- src/Targets/Microchip/AVR/AVR8/Avr8.hpp | 12 ++++++------ src/Targets/Target.hpp | 4 ++-- src/Targets/TargetMemory.hpp | 1 - 27 files changed, 46 insertions(+), 49 deletions(-) diff --git a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp index 9a2a9764..95ed4d1d 100644 --- a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp +++ b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.cpp @@ -142,7 +142,7 @@ namespace DebugServer::Gdb::AvrGdb }; } - void AvrGdbRsp::handleTargetStoppedGdbResponse(Targets::TargetProgramCounter programAddress) { + void AvrGdbRsp::handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) { using Services::StringService; Logger::debug("Target stopped at byte address: 0x" + StringService::toHex(programAddress)); diff --git a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp index 77e6e61b..1e648366 100644 --- a/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp +++ b/src/DebugServer/Gdb/AvrGdb/AvrGdbRsp.hpp @@ -45,7 +45,7 @@ namespace DebugServer::Gdb::AvrGdb */ std::set>> getSupportedFeatures(); - void handleTargetStoppedGdbResponse(Targets::TargetProgramCounter programAddress) override; + void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) override; private: TargetDescriptor gdbTargetDescriptor; diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp index f17dde27..5479c2fe 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/ReadRegisters.cpp @@ -46,7 +46,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets } Targets::TargetRegisters registerSet; - Targets::TargetProgramCounter programCounter; + Targets::TargetMemoryAddress programCounter; { const auto atomicSession = targetControllerService.makeAtomicSession(); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp index f74818c2..61053866 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.cpp @@ -45,8 +45,8 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets : commandData.end() ); - this->startAddress = static_cast(std::stoi(startAddressHex, nullptr, 16)); - this->endAddress = static_cast(std::stoi(endAddressHex, nullptr, 16)); + this->startAddress = static_cast(std::stoi(startAddressHex, nullptr, 16)); + this->endAddress = static_cast(std::stoi(endAddressHex, nullptr, 16)); } void VContRangeStep::handle(Gdb::DebugSession& debugSession, TargetControllerService& targetControllerService) { diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp index 66cc3361..490f96df 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/VContRangeStep.hpp @@ -16,8 +16,8 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets class VContRangeStep: public Gdb::CommandPackets::CommandPacket { public: - Targets::TargetProgramCounter startAddress; - Targets::TargetProgramCounter endAddress; + Targets::TargetMemoryAddress startAddress; + Targets::TargetMemoryAddress endAddress; explicit VContRangeStep(const RawPacket& rawPacket); diff --git a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp index 54bfdef7..afa4a8bf 100644 --- a/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp +++ b/src/DebugServer/Gdb/AvrGdb/CommandPackets/WriteRegister.cpp @@ -52,7 +52,7 @@ namespace DebugServer::Gdb::AvrGdb::CommandPackets try { if (this->registerId == TargetDescriptor::PROGRAM_COUNTER_GDB_REGISTER_ID) { targetControllerService.setProgramCounter( - static_cast( + static_cast( (this->registerValue.size() >= 1 ? this->registerValue[0] : 0x00) << 24 | (this->registerValue.size() >= 2 ? this->registerValue[1] : 0x00) << 16 | (this->registerValue.size() >= 3 ? this->registerValue[2] : 0x00) << 8 diff --git a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp index afec13ec..aa0e445a 100644 --- a/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp +++ b/src/DebugServer/Gdb/CommandPackets/ContinueExecution.cpp @@ -16,7 +16,7 @@ namespace DebugServer::Gdb::CommandPackets : CommandPacket(rawPacket) { if (this->data.size() > 2) { - this->fromAddress = static_cast( + this->fromAddress = static_cast( std::stoi(std::string(this->data.begin() + 2, this->data.end()), nullptr, 16) ); } diff --git a/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp b/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp index c029cd59..f9987fd5 100644 --- a/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp +++ b/src/DebugServer/Gdb/CommandPackets/StepExecution.cpp @@ -17,7 +17,7 @@ namespace DebugServer::Gdb::CommandPackets : CommandPacket(rawPacket) { if (this->data.size() > 2) { - this->fromAddress = static_cast( + this->fromAddress = static_cast( std::stoi(std::string(this->data.begin() + 2, this->data.end()), nullptr, 16) ); } diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.cpp b/src/DebugServer/Gdb/GdbRspDebugServer.cpp index d9039812..cd6e25f3 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.cpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.cpp @@ -370,7 +370,7 @@ namespace DebugServer::Gdb } } - void GdbRspDebugServer::handleTargetStoppedGdbResponse(Targets::TargetProgramCounter programAddress) { + void GdbRspDebugServer::handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress) { auto* debugSession = this->getActiveDebugSession(); if (debugSession->activeRangeSteppingSession.has_value()) { diff --git a/src/DebugServer/Gdb/GdbRspDebugServer.hpp b/src/DebugServer/Gdb/GdbRspDebugServer.hpp index 5bd17be0..99f6bb52 100644 --- a/src/DebugServer/Gdb/GdbRspDebugServer.hpp +++ b/src/DebugServer/Gdb/GdbRspDebugServer.hpp @@ -199,7 +199,7 @@ namespace DebugServer::Gdb */ void onTargetExecutionResumed(const Events::TargetExecutionResumed&); - virtual void handleTargetStoppedGdbResponse(Targets::TargetProgramCounter programAddress); + virtual void handleTargetStoppedGdbResponse(Targets::TargetMemoryAddress programAddress); virtual void handleTargetResumedGdbResponse(); }; } diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp index a387ea5c..ab20b06b 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.cpp @@ -81,7 +81,6 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr using Targets::TargetMemoryBuffer; using Targets::TargetMemoryAddress; using Targets::TargetMemorySize; - using Targets::TargetProgramCounter; using Targets::TargetRegister; using Targets::TargetRegisterDescriptor; using Targets::TargetRegisterDescriptors; @@ -279,7 +278,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr } } - TargetProgramCounter EdbgAvr8Interface::getProgramCounter() { + TargetMemoryAddress EdbgAvr8Interface::getProgramCounter() { if (this->targetState != TargetState::STOPPED) { this->stop(); } @@ -295,7 +294,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr return responseFrame.extractProgramCounter(); } - void EdbgAvr8Interface::setProgramCounter(TargetProgramCounter programCounter) { + void EdbgAvr8Interface::setProgramCounter(TargetMemoryAddress programCounter) { if (this->targetState != TargetState::STOPPED) { this->stop(); } diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp index 295a33bd..56f0bf7c 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/EdbgAvr8Interface.hpp @@ -142,7 +142,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr * * @return */ - Targets::TargetProgramCounter getProgramCounter() override; + Targets::TargetMemoryAddress getProgramCounter() override; /** * Issues the "PC Write" command to the debug tool, setting the program counter on the target. @@ -150,7 +150,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr * @param programCounter * The byte address to set as the program counter. */ - void setProgramCounter(Targets::TargetProgramCounter programCounter) override; + void setProgramCounter(Targets::TargetMemoryAddress programCounter) override; /** * Issues the "Get ID" command to the debug tool, to extract the signature from the target. diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp index 0676d69b..8c07989b 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AVR8Generic/GetProgramCounter.hpp @@ -17,7 +17,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames::Avr8 : Avr8GenericResponseFrame(avrResponses) {} - Targets::TargetProgramCounter extractProgramCounter() const { + Targets::TargetMemoryAddress extractProgramCounter() const { /* * The payload for the PC Read command should always consist of six bytes. Thr first two being the * command ID and version, the other four being the PC. The four PC bytes are little-endian. @@ -27,7 +27,7 @@ namespace DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr::ResponseFrames::Avr8 "frame - unexpected payload size."); } - return static_cast( + return static_cast( this->payload[5] << 24 | this->payload[4] << 16 | this->payload[3] << 8 | this->payload[2] ) * 2; } diff --git a/src/DebugToolDrivers/TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp b/src/DebugToolDrivers/TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp index 2f90805f..72b4e689 100644 --- a/src/DebugToolDrivers/TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp +++ b/src/DebugToolDrivers/TargetInterfaces/Microchip/AVR/AVR8/Avr8DebugInterface.hpp @@ -133,14 +133,14 @@ namespace DebugToolDrivers::TargetInterfaces::Microchip::Avr::Avr8 * * @return */ - virtual Targets::TargetProgramCounter getProgramCounter() = 0; + virtual Targets::TargetMemoryAddress getProgramCounter() = 0; /** * Should update the program counter value on the target. * * @param programCounter */ - virtual void setProgramCounter(Targets::TargetProgramCounter programCounter) = 0; + virtual void setProgramCounter(Targets::TargetMemoryAddress programCounter) = 0; /** * Should read the requested registers from the target. diff --git a/src/EventManager/Events/TargetExecutionStopped.hpp b/src/EventManager/Events/TargetExecutionStopped.hpp index 3ae02311..97616e7f 100644 --- a/src/EventManager/Events/TargetExecutionStopped.hpp +++ b/src/EventManager/Events/TargetExecutionStopped.hpp @@ -16,10 +16,10 @@ namespace Events static constexpr EventType type = EventType::TARGET_EXECUTION_STOPPED; static const inline std::string name = "TargetExecutionStopped"; - Targets::TargetProgramCounter programCounter; + Targets::TargetMemoryAddress programCounter; Targets::TargetBreakCause breakCause; - TargetExecutionStopped(Targets::TargetProgramCounter programCounter, Targets::TargetBreakCause breakCause) + TargetExecutionStopped(Targets::TargetMemoryAddress programCounter, Targets::TargetBreakCause breakCause) : programCounter(programCounter) , breakCause(breakCause) {} diff --git a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp index 020ef3f2..eaaefc2d 100644 --- a/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp +++ b/src/Insight/InsightWorker/Tasks/ReadProgramCounter.hpp @@ -22,7 +22,7 @@ public: }; signals: - void programCounterRead(Targets::TargetProgramCounter programCounter); + void programCounterRead(Targets::TargetMemoryAddress programCounter); protected: void run(Services::TargetControllerService& targetControllerService) override; diff --git a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp index 4a9ff757..c07a432f 100644 --- a/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/InsightWindow.cpp @@ -854,7 +854,7 @@ void InsightWindow::refreshProgramCounter(std::optionalprogramCounterValueLabel->setText( "0x" + QString::number(programCounter, 16).toUpper() + " (" + QString::number(programCounter) + ")" ); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.cpp index 2ddd689c..887bbbf7 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.cpp @@ -12,7 +12,7 @@ MemorySnapshot::MemorySnapshot( const QString& description, Targets::TargetMemoryType memoryType, const Targets::TargetMemoryBuffer& data, - Targets::TargetProgramCounter programCounter, + Targets::TargetMemoryAddress programCounter, Targets::TargetStackPointer stackPointer, const std::vector& focusedRegions, const std::vector& excludedRegions @@ -50,7 +50,7 @@ MemorySnapshot::MemorySnapshot(const QJsonObject& jsonObject) { this->name = jsonObject.find("name")->toString(); this->description = jsonObject.find("description")->toString(); this->memoryType = EnumToStringMappings::targetMemoryTypes.at(jsonObject.find("memoryType")->toString()); - this->programCounter = static_cast(jsonObject.find("programCounter")->toInteger()); + this->programCounter = static_cast(jsonObject.find("programCounter")->toInteger()); this->stackPointer = static_cast(jsonObject.find("stackPointer")->toInteger()); this->createdDate.setSecsSinceEpoch(jsonObject.find("createdTimestamp")->toInteger()); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.hpp index 0d4224c2..95abd448 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/MemorySnapshot.hpp @@ -20,7 +20,7 @@ public: QString description; Targets::TargetMemoryType memoryType; Targets::TargetMemoryBuffer data; - Targets::TargetProgramCounter programCounter; + Targets::TargetMemoryAddress programCounter; Targets::TargetStackPointer stackPointer; QDateTime createdDate = Services::DateTimeService::currentDateTime(); @@ -32,7 +32,7 @@ public: const QString& description, Targets::TargetMemoryType memoryType, const Targets::TargetMemoryBuffer& data, - Targets::TargetProgramCounter programCounter, + Targets::TargetMemoryAddress programCounter, Targets::TargetStackPointer stackPointer, const std::vector& focusedRegions, const std::vector& excludedRegions diff --git a/src/Services/TargetControllerService.cpp b/src/Services/TargetControllerService.cpp index dbed3525..a0f9e148 100644 --- a/src/Services/TargetControllerService.cpp +++ b/src/Services/TargetControllerService.cpp @@ -64,7 +64,6 @@ namespace Services using Targets::TargetMemorySize; using Targets::TargetMemoryAddressRange; using Targets::TargetMemoryBuffer; - using Targets::TargetProgramCounter; using Targets::TargetStackPointer; using Targets::TargetBreakpoint; @@ -237,7 +236,7 @@ namespace Services ); } - TargetProgramCounter TargetControllerService::getProgramCounter() const { + TargetMemoryAddress TargetControllerService::getProgramCounter() const { return this->commandManager.sendCommandAndWaitForResponse( std::make_unique(), this->defaultTimeout, @@ -245,7 +244,7 @@ namespace Services )->programCounter; } - void TargetControllerService::setProgramCounter(TargetProgramCounter address) const { + void TargetControllerService::setProgramCounter(TargetMemoryAddress address) const { this->commandManager.sendCommandAndWaitForResponse( std::make_unique(address), this->defaultTimeout, diff --git a/src/Services/TargetControllerService.hpp b/src/Services/TargetControllerService.hpp index 116d7983..b0baac19 100644 --- a/src/Services/TargetControllerService.hpp +++ b/src/Services/TargetControllerService.hpp @@ -165,14 +165,14 @@ namespace Services * * @return */ - Targets::TargetProgramCounter getProgramCounter() const; + Targets::TargetMemoryAddress getProgramCounter() const; /** * Sets the target's program counter to the given address. * * @param address */ - void setProgramCounter(Targets::TargetProgramCounter address) const; + void setProgramCounter(Targets::TargetMemoryAddress address) const; /** * Retrieves the pin states for a particular target variant. diff --git a/src/TargetController/Commands/SetTargetProgramCounter.hpp b/src/TargetController/Commands/SetTargetProgramCounter.hpp index 2ef388b0..14ad78b7 100644 --- a/src/TargetController/Commands/SetTargetProgramCounter.hpp +++ b/src/TargetController/Commands/SetTargetProgramCounter.hpp @@ -14,9 +14,9 @@ namespace TargetController::Commands static constexpr CommandType type = CommandType::SET_TARGET_PROGRAM_COUNTER; static const inline std::string name = "SetTargetProgramCounter"; - Targets::TargetProgramCounter address = 0; + Targets::TargetMemoryAddress address = 0; - explicit SetTargetProgramCounter(Targets::TargetProgramCounter address) + explicit SetTargetProgramCounter(Targets::TargetMemoryAddress address) : address(address) {}; diff --git a/src/TargetController/Commands/StepTargetExecution.hpp b/src/TargetController/Commands/StepTargetExecution.hpp index 4c535482..10eeb1a0 100644 --- a/src/TargetController/Commands/StepTargetExecution.hpp +++ b/src/TargetController/Commands/StepTargetExecution.hpp @@ -14,10 +14,10 @@ namespace TargetController::Commands static constexpr CommandType type = CommandType::STEP_TARGET_EXECUTION; static const inline std::string name = "StepTargetExecution"; - std::optional fromProgramCounter; + std::optional fromProgramCounter; StepTargetExecution() = default; - explicit StepTargetExecution(Targets::TargetProgramCounter fromProgramCounter) + explicit StepTargetExecution(Targets::TargetMemoryAddress fromProgramCounter) : fromProgramCounter(fromProgramCounter) {}; diff --git a/src/TargetController/Responses/TargetProgramCounter.hpp b/src/TargetController/Responses/TargetProgramCounter.hpp index eb6b0395..515e9c92 100644 --- a/src/TargetController/Responses/TargetProgramCounter.hpp +++ b/src/TargetController/Responses/TargetProgramCounter.hpp @@ -13,9 +13,9 @@ namespace TargetController::Responses public: static constexpr ResponseType type = ResponseType::TARGET_PROGRAM_COUNTER; - Targets::TargetProgramCounter programCounter; + Targets::TargetMemoryAddress programCounter; - explicit TargetProgramCounter(Targets::TargetProgramCounter programCounter) + explicit TargetProgramCounter(Targets::TargetMemoryAddress programCounter) : programCounter(programCounter) {} diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp index bfd1e22f..4e0060e5 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.hpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.hpp @@ -59,11 +59,11 @@ namespace Targets::Microchip::Avr::Avr8Bit void step() override; void reset() override; - void setSoftwareBreakpoint(TargetProgramCounter address) override; - void removeSoftwareBreakpoint(TargetProgramCounter address) override; + void setSoftwareBreakpoint(TargetMemoryAddress address) override; + void removeSoftwareBreakpoint(TargetMemoryAddress address) override; - void setHardwareBreakpoint(TargetProgramCounter address) override; - void removeHardwareBreakpoint(TargetProgramCounter address) override; + void setHardwareBreakpoint(TargetMemoryAddress address) override; + void removeHardwareBreakpoint(TargetMemoryAddress address) override; void clearAllBreakpoints() override; void writeRegisters(TargetRegisters registers) override; @@ -84,8 +84,8 @@ namespace Targets::Microchip::Avr::Avr8Bit TargetState getState() override; - TargetProgramCounter getProgramCounter() override; - void setProgramCounter(TargetProgramCounter programCounter) override; + TargetMemoryAddress getProgramCounter() override; + void setProgramCounter(TargetMemoryAddress programCounter) override; TargetStackPointer getStackPointer() override; diff --git a/src/Targets/Target.hpp b/src/Targets/Target.hpp index 53835aad..647045c4 100644 --- a/src/Targets/Target.hpp +++ b/src/Targets/Target.hpp @@ -210,14 +210,14 @@ namespace Targets * * @return */ - virtual TargetProgramCounter getProgramCounter() = 0; + virtual TargetMemoryAddress getProgramCounter() = 0; /** * Should update the program counter on the target. * * @param programCounter */ - virtual void setProgramCounter(TargetProgramCounter programCounter) = 0; + virtual void setProgramCounter(TargetMemoryAddress programCounter) = 0; /** * Should fetch the current stack pointer value. diff --git a/src/Targets/TargetMemory.hpp b/src/Targets/TargetMemory.hpp index 6655183b..65aed6e9 100644 --- a/src/Targets/TargetMemory.hpp +++ b/src/Targets/TargetMemory.hpp @@ -9,7 +9,6 @@ namespace Targets { using TargetMemoryAddress = std::uint32_t; using TargetMemorySize = std::uint32_t; - using TargetProgramCounter = TargetMemoryAddress; using TargetStackPointer = TargetMemoryAddress; using TargetMemoryBuffer = std::vector;