2023-07-02 19:51:09 +02:00
|
|
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <functional>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
2023-12-07 09:12:54 +01:00
|
|
|
#include <cm3p/cppdap/protocol.h>
|
|
|
|
#include <cm3p/cppdap/types.h>
|
2023-07-02 19:51:09 +02:00
|
|
|
|
|
|
|
namespace cmDebugger {
|
|
|
|
|
|
|
|
class cmDebuggerVariablesManager
|
|
|
|
{
|
|
|
|
std::unordered_map<
|
|
|
|
int64_t,
|
|
|
|
std::function<dap::array<dap::Variable>(dap::VariablesRequest const&)>>
|
|
|
|
VariablesHandlers;
|
|
|
|
void RegisterHandler(
|
|
|
|
int64_t id,
|
|
|
|
std::function<dap::array<dap::Variable>(dap::VariablesRequest const&)>
|
|
|
|
handler);
|
|
|
|
void UnregisterHandler(int64_t id);
|
|
|
|
friend class cmDebuggerVariables;
|
|
|
|
|
|
|
|
public:
|
|
|
|
cmDebuggerVariablesManager() = default;
|
|
|
|
dap::array<dap::Variable> HandleVariablesRequest(
|
|
|
|
dap::VariablesRequest const& request);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace cmDebugger
|