LLDB mainline
PseudoConsole.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 LIBLLDB_HOST_WINDOWS_PSEUDOCONSOLE_H_
10#define LIBLLDB_HOST_WINDOWS_PSEUDOCONSOLE_H_
11
12#include "llvm/Support/Error.h"
13#include <string>
14
15#define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE 0x20016
16typedef void *HANDLE;
17typedef void *HPCON;
18
19namespace lldb_private {
20
22
23public:
24 PseudoConsole() = default;
26
27 PseudoConsole(const PseudoConsole &) = delete;
31
32 llvm::Error OpenPseudoConsole();
33
34 /// Close the ConPTY, its read/write handles and invalidate them.
35 void Close();
36
37 /// The ConPTY HPCON handle accessor.
38 ///
39 /// This object retains ownership of the HPCON when this accessor is used.
40 ///
41 /// \return
42 /// The ConPTY HPCON handle, or INVALID_HANDLE_VALUE if it is currently
43 /// invalid.
45
46 /// The STDOUT read HANDLE accessor.
47 ///
48 /// This object retains ownership of the HANDLE when this accessor is used.
49 ///
50 /// \return
51 /// The STDOUT read HANDLE, or INVALID_HANDLE_VALUE if it is currently
52 /// invalid.
54
55 /// The STDIN write HANDLE accessor.
56 ///
57 /// This object retains ownership of the HANDLE when this accessor is used.
58 ///
59 /// \return
60 /// The STDIN write HANDLE, or INVALID_HANDLE_VALUE if it is currently
61 /// invalid.
63
64protected:
65 HANDLE m_conpty_handle = ((HANDLE)(long long)-1);
66 HANDLE m_conpty_output = ((HANDLE)(long long)-1);
67 HANDLE m_conpty_input = ((HANDLE)(long long)-1);
68};
69} // namespace lldb_private
70
71#endif // LIBLLDB_HOST_WINDOWS_PSEUDOCONSOLE_H_
void * HPCON
void * HANDLE
PseudoConsole(const PseudoConsole &)=delete
PseudoConsole & operator=(const PseudoConsole &)=delete
PseudoConsole & operator=(PseudoConsole &&)=delete
HANDLE GetSTDOUTHandle() const
The STDOUT read HANDLE accessor.
void Close()
Close the ConPTY, its read/write handles and invalidate them.
HPCON GetPseudoTerminalHandle()
The ConPTY HPCON handle accessor.
PseudoConsole(PseudoConsole &&)=delete
HANDLE GetSTDINHandle() const
The STDIN write HANDLE accessor.
A class that represents a running process on the host machine.