2021-04-04 21:04:12 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
|
|
#include "CommandPacket.hpp"
|
|
|
|
|
#include "../Feature.hpp"
|
|
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace DebugServer::Gdb::CommandPackets
|
2021-04-04 21:04:12 +01:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The SupportedFeaturesQuery command packet is a query from the GDB client, requesting a list of GDB features
|
|
|
|
|
* supported by the GDB server. The body of this packet also contains a list GDB features that are supported or
|
|
|
|
|
* unsupported by the GDB client.
|
|
|
|
|
*
|
|
|
|
|
* The command packet is identified by its 'qSupported' prefix in the command packet data. Following the prefix is
|
|
|
|
|
* a list of GDB features that are supported/unsupported by the client. For more info on this command
|
|
|
|
|
* packet, see the GDP RSP documentation.
|
|
|
|
|
*
|
|
|
|
|
* Responses to this command packet should take the form of a ResponsePackets::SupportedFeaturesResponse.
|
|
|
|
|
*/
|
|
|
|
|
class SupportedFeaturesQuery: public CommandPacket
|
|
|
|
|
{
|
|
|
|
|
public:
|
2022-10-01 21:01:37 +01:00
|
|
|
explicit SupportedFeaturesQuery(const RawPacket& rawPacket);
|
2021-04-04 21:04:12 +01:00
|
|
|
|
2021-06-22 23:52:31 +01:00
|
|
|
[[nodiscard]] bool isFeatureSupported(const Feature& feature) const {
|
2021-04-04 21:04:12 +01:00
|
|
|
return this->supportedFeatures.find(feature) != this->supportedFeatures.end();
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-22 23:52:31 +01:00
|
|
|
[[nodiscard]] const std::set<Feature>& getSupportedFeatures() const {
|
2021-04-04 21:04:12 +01:00
|
|
|
return this->supportedFeatures;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-09 15:57:24 +01:00
|
|
|
void handle(
|
|
|
|
|
DebugSession& debugSession,
|
2024-07-23 21:14:22 +01:00
|
|
|
const TargetDescriptor& gdbTargetDescriptor,
|
|
|
|
|
const Targets::TargetDescriptor& targetDescriptor,
|
2022-12-26 21:27:19 +00:00
|
|
|
Services::TargetControllerService& targetControllerService
|
2022-04-09 15:57:24 +01:00
|
|
|
) override;
|
2021-10-06 21:12:31 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::set<Feature> supportedFeatures;
|
2021-04-04 21:04:12 +01:00
|
|
|
};
|
|
|
|
|
}
|