brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 0c65766 Raw
47 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_PLUGINS_PROTOCOL_MCP_RESOURCE_H10#define LLDB_PLUGINS_PROTOCOL_MCP_RESOURCE_H11 12#include "lldb/Protocol/MCP/Protocol.h"13#include "lldb/Protocol/MCP/Resource.h"14#include "lldb/lldb-forward.h"15#include "lldb/lldb-types.h"16#include "llvm/ADT/StringRef.h"17#include "llvm/Support/Error.h"18#include <cstddef>19#include <vector>20 21namespace lldb_private::mcp {22 23class DebuggerResourceProvider : public lldb_protocol::mcp::ResourceProvider {24public:25  using ResourceProvider::ResourceProvider;26  virtual ~DebuggerResourceProvider() = default;27 28  std::vector<lldb_protocol::mcp::Resource> GetResources() const override;29  llvm::Expected<lldb_protocol::mcp::ReadResourceResult>30  ReadResource(llvm::StringRef uri) const override;31 32private:33  static lldb_protocol::mcp::Resource GetDebuggerResource(Debugger &debugger);34  static lldb_protocol::mcp::Resource GetTargetResource(size_t target_idx,35                                                        Target &target);36 37  static llvm::Expected<lldb_protocol::mcp::ReadResourceResult>38  ReadDebuggerResource(llvm::StringRef uri, lldb::user_id_t debugger_id);39  static llvm::Expected<lldb_protocol::mcp::ReadResourceResult>40  ReadTargetResource(llvm::StringRef uri, lldb::user_id_t debugger_id,41                     size_t target_idx);42};43 44} // namespace lldb_private::mcp45 46#endif47