This commit is contained in:
Nav
2025-02-18 00:36:35 +00:00
parent 8a473473db
commit be76726124
11 changed files with 17 additions and 38 deletions

View File

@@ -100,10 +100,10 @@ namespace DebugServer::Gdb
, eventListener(eventListener)
, interruptEventNotifier(eventNotifier)
, targetState(this->targetControllerService.getTargetState())
{};
{}
GdbRspDebugServer() = delete;
virtual ~GdbRspDebugServer() = default;
~GdbRspDebugServer() override = default;
GdbRspDebugServer(const GdbRspDebugServer& other) = delete;
GdbRspDebugServer(GdbRspDebugServer&& other) = delete;
@@ -111,9 +111,6 @@ namespace DebugServer::Gdb
GdbRspDebugServer& operator = (const GdbRspDebugServer& other) = delete;
GdbRspDebugServer& operator = (GdbRspDebugServer&& other) = delete;
/**
* Prepares the GDB server for listing on the selected address and port.
*/
void init() override {
this->socketAddress.sin_family = AF_INET;
this->socketAddress.sin_port = htons(this->debugServerConfig.listeningPortNumber);
@@ -189,9 +186,6 @@ namespace DebugServer::Gdb
}
}
/**
* Terminates any active debug session and closes the listening socket.
*/
void close() override {
this->endDebugSession();
@@ -200,11 +194,6 @@ namespace DebugServer::Gdb
}
}
/**
* Waits for a connection from a GDB client or services an active one.
*
* This function will return when any blocking operation is interrupted via this->interruptEventNotifier.
*/
void run() override {
try {
if (!this->debugSession.has_value()) {
@@ -443,10 +432,6 @@ namespace DebugServer::Gdb
const auto rawPacketString = std::string{rawPacket.begin() + 1, rawPacket.end()};
/*
* First byte of the raw packet will be 0x24 ('$'), so std::string::find() should return 1, not 0, when
* looking for a command identifier string.
*/
if (rawPacketString.find("qSupported") == 0) {
return std::make_unique<CommandPackets::SupportedFeaturesQuery>(rawPacket);
}

View File

@@ -10,7 +10,7 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink::Commands::Control
{
public:
AttachTarget()
: Command(0x0d)
: Command(0x0D)
{
this->payload = {
0x02

View File

@@ -10,10 +10,10 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink::Commands::Control
{
public:
DetachTarget()
: Command(0x0d)
: Command(0x0D)
{
this->payload = {
0xff
0xFF
};
}
};

View File

@@ -10,7 +10,7 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink::Commands::Control
{
public:
GetDeviceInfo()
: Command(0x0d)
: Command(0x0D)
{
this->payload = {
0x01

View File

@@ -10,7 +10,7 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink::Commands::Control
{
public:
PostAttach()
: Command(0x0d)
: Command(0x0D)
{
this->payload = {
0x03

View File

@@ -10,7 +10,7 @@ namespace DebugToolDrivers::Wch::Protocols::WchLink::Commands
{
public:
SetClockSpeed(std::uint8_t targetGroupId, std::uint8_t speedId)
: Command(0x0c)
: Command(0x0C)
{
this->payload = {
targetGroupId,

View File

@@ -374,7 +374,7 @@ void InsightWindow::selectDefaultVariant() {
}
Logger::error(
"Unsupported target variant (\"" + descriptor.name + "\") provided via 'defaultVariantKey' parameter"
"Unsupported target variant (\"" + descriptor.name + "\") provided via 'default_variant_key' parameter"
);
} else {

View File

@@ -243,11 +243,9 @@ namespace Targets::Microchip::Avr8
) {
Logger::debug("Attempting OCDEN fuse bit management");
this->updateOcdenFuseBit(false);
} else {
this->avr8DebugInterface->deactivate();
}
this->avr8DebugInterface->deactivate();
this->activated = false;
} catch (const Exception& exception) {

View File

@@ -9,14 +9,14 @@ namespace Targets::RiscV::Opcodes
enum class GprNumber: std::uint8_t
{
X0 = 0, X2 = 2, X3 = 3, X4 = 4, X5 = 5, X6 = 6, X7 = 7, X8 = 8, X9 = 9, X10 = 10, X11 = 11, X12 = 12, X13 = 13,
X14 = 14, X15 = 15, X16 = 16, X17 = 17, X18 = 18, X19 = 19, X20 = 20, X21 = 21, X22 = 22, X23 = 23, X24 = 24,
X25 = 25, X26 = 26, X27 = 27, X28 = 28, X29 = 29, X30 = 30, X31 = 31,
X0 = 0, X1 = 1, X2 = 2, X3 = 3, X4 = 4, X5 = 5, X6 = 6, X7 = 7, X8 = 8, X9 = 9, X10 = 10, X11 = 11, X12 = 12,
X13 = 13, X14 = 14, X15 = 15, X16 = 16, X17 = 17, X18 = 18, X19 = 19, X20 = 20, X21 = 21, X22 = 22, X23 = 23,
X24 = 24, X25 = 25, X26 = 26, X27 = 27, X28 = 28, X29 = 29, X30 = 30, X31 = 31,
};
static constexpr auto Ebreak = Opcode{0x00100073};
static constexpr auto EbreakCompressed = OpcodeCompressed{0x9002};
static constexpr auto Fence = Opcode{0x0000000f};
static constexpr auto FenceI = Opcode{0x0000100f};
static constexpr auto Fence = Opcode{0x0000000F};
static constexpr auto FenceI = Opcode{0x0000100F};
}

View File

@@ -272,11 +272,7 @@ namespace Targets::RiscV::Wch
const auto& aliasedSegment = this->selectedProgramSegmentDescriptor;
const auto transformedAddress = this->deAliasMappedAddress(startAddress, aliasedSegment);
const auto addressRange = TargetMemoryAddressRange{
transformedAddress,
static_cast<TargetMemoryAddress>(transformedAddress + bytes - 1)
};
const auto addressRange = TargetMemoryAddressRange{transformedAddress, transformedAddress + bytes - 1};
if (!aliasedSegment.addressRange.contains(addressRange)) {
throw Exceptions::Exception{
"Read access range (0x" + StringService::toHex(addressRange.startAddress) + " -> 0x"