Files
BloomPatched/src/DebugServer/Gdb/ResponsePackets/SupportedFeaturesResponse.cpp

26 lines
859 B
C++
Raw Normal View History

2021-04-04 21:04:12 +01:00
#include "SupportedFeaturesResponse.hpp"
namespace Bloom::DebugServer::Gdb::ResponsePackets
{
std::vector<unsigned char> SupportedFeaturesResponse::getData() const {
std::string output = "qSupported:";
auto gdbFeatureMapping = getGdbFeatureToNameMapping();
2021-04-04 21:04:12 +01:00
for (const auto& supportedFeature : this->supportedFeatures) {
auto featureString = gdbFeatureMapping.valueAt(supportedFeature.first);
2021-04-04 21:04:12 +01:00
if (featureString.has_value()) {
if (supportedFeature.second.has_value()) {
output.append(featureString.value() + "=" + supportedFeature.second.value() + ";");
2021-04-04 21:04:12 +01:00
} else {
output.append(featureString.value() + "+;");
}
2021-04-04 21:04:12 +01:00
}
2021-04-04 21:04:12 +01:00
}
return std::vector<unsigned char>(output.begin(), output.end());
}
2021-04-04 21:04:12 +01:00
}