General tidying, addressing issues found by static analysis tool.
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Bloom::DebugServers::Gdb::ResponsePackets
|
||||
public:
|
||||
Ok() = default;
|
||||
|
||||
std::vector<unsigned char> getData() const override {
|
||||
[[nodiscard]] std::vector<unsigned char> getData() const override {
|
||||
return {'O', 'K'};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
#include "ResponsePacket.hpp"
|
||||
#include "../Feature.hpp"
|
||||
@@ -17,9 +18,9 @@ namespace Bloom::DebugServers::Gdb::ResponsePackets
|
||||
|
||||
public:
|
||||
SupportedFeaturesResponse() = default;
|
||||
SupportedFeaturesResponse(const std::set<std::pair<Feature, std::optional<std::string>>>& supportedFeatures)
|
||||
: supportedFeatures(supportedFeatures) {};
|
||||
explicit SupportedFeaturesResponse(std::set<std::pair<Feature, std::optional<std::string>>> supportedFeatures)
|
||||
: supportedFeatures(std::move(supportedFeatures)) {};
|
||||
|
||||
std::vector<unsigned char> getData() const override;
|
||||
[[nodiscard]] std::vector<unsigned char> getData() const override;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ namespace Bloom::DebugServers::Gdb::ResponsePackets
|
||||
std::optional<Targets::TargetRegisterMap> registerMap;
|
||||
std::optional<StopReason> stopReason;
|
||||
|
||||
TargetStopped(Signal signal): signal(signal) {}
|
||||
explicit TargetStopped(Signal signal): signal(signal) {}
|
||||
|
||||
std::vector<unsigned char> getData() const override {
|
||||
std::string output = "T" + this->dataToHex({static_cast<unsigned char>(this->signal)});
|
||||
[[nodiscard]] std::vector<unsigned char> getData() const override {
|
||||
std::string output = "T" + Packet::dataToHex({static_cast<unsigned char>(this->signal)});
|
||||
|
||||
if (this->stopReason.has_value()) {
|
||||
auto stopReasonMapping = getStopReasonToNameMapping();
|
||||
@@ -34,8 +34,8 @@ namespace Bloom::DebugServers::Gdb::ResponsePackets
|
||||
|
||||
if (this->registerMap.has_value()) {
|
||||
for (const auto& [registerId, registerValue] : this->registerMap.value()) {
|
||||
output += this->dataToHex({static_cast<unsigned char>(registerId)});
|
||||
output += ":" + this->dataToHex(registerValue.value) + ";";
|
||||
output += Packet::dataToHex({static_cast<unsigned char>(registerId)});
|
||||
output += ":" + Packet::dataToHex(registerValue.value) + ";";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user