LLDB
mainline
llvm-project
lldb
source
Protocol
MCP
Transport.cpp
Go to the documentation of this file.
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-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
lldb/Protocol/MCP/Transport.h
"
10
#include "llvm/ADT/StringRef.h"
11
#include <utility>
12
13
using namespace
lldb_protocol::mcp
;
14
using namespace
llvm
;
15
16
Transport::Transport
(
lldb::IOObjectSP
in,
lldb::IOObjectSP
out,
17
LogCallback
log_callback)
18
: JSONRPCTransport(in, out),
m_log_callback
(std::move(log_callback)) {}
19
20
void
Transport::Log
(StringRef message) {
21
if
(
m_log_callback
)
22
m_log_callback
(message);
23
}
Transport.h
lldb_protocol::mcp::Transport::Transport
Transport(lldb::IOObjectSP in, lldb::IOObjectSP out, LogCallback log_callback={})
Definition
Transport.cpp:16
lldb_protocol::mcp::Transport::m_log_callback
LogCallback m_log_callback
Definition
Transport.h:43
lldb_protocol::mcp::Transport::Log
void Log(llvm::StringRef message) override
lldb_protocol::mcp
Definition
MCPError.h:16
lldb_protocol::mcp::LogCallback
llvm::unique_function< void(llvm::StringRef message)> LogCallback
Generic logging callback, to allow the MCP server / client / transport layer to be independent of the...
Definition
Transport.h:25
lldb::IOObjectSP
std::shared_ptr< lldb_private::IOObject > IOObjectSP
Definition
lldb-forward.h:366
llvm
Definition
Debugger.h:58
Generated on
for LLDB by
1.14.0