LLDB mainline
ConnectionConPTYWindows.h
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#ifndef LLDB_HOST_WINDOWS_CONNECTIONCONPTYWINDOWS_H
10#define LLDB_HOST_WINDOWS_CONNECTIONCONPTYWINDOWS_H
11
16#include "lldb/lldb-types.h"
17#include <mutex>
18
19namespace lldb_private {
20
21/// A read only Connection implementation for the Windows ConPTY.
23public:
24 ConnectionConPTY(std::shared_ptr<PseudoConsole> pty);
25
27
28 lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override;
29
30 lldb::ConnectionStatus Disconnect(Status *error_ptr) override;
31
32 /// Read from the ConPTY's pipe.
33 ///
34 /// Before reading, check if the ConPTY is closing and wait for it to close
35 /// before reading. This prevents race conditions when closing the ConPTY
36 /// during a read. After reading, remove the ConPTY VT init sequence if
37 /// present.
38 size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout,
39 lldb::ConnectionStatus &status, Status *error_ptr) override;
40
41 size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status,
42 Status *error_ptr) override;
43
44protected:
45 std::shared_ptr<PseudoConsole> m_pty;
47};
48} // namespace lldb_private
49
50#endif
lldb::ConnectionStatus Disconnect(Status *error_ptr) override
Disconnect the communications connection if one is currently connected.
size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr) override
The actual write function that attempts to write to the communications protocol.
ConnectionConPTY(std::shared_ptr< PseudoConsole > pty)
size_t Read(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr) override
Read from the ConPTY's pipe.
std::shared_ptr< PseudoConsole > m_pty
lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override
Connect using the connect string url.
An error handling class.
Definition Status.h:118
A class that represents a running process on the host machine.
ConnectionStatus
Connection Status Types.