[Lldb-commits] [lldb] [llvm] [lldb][windows] add Windows Virtual Console support (PR #168729)

Charles Zablit via lldb-commits lldb-commits at lists.llvm.org
Wed Dec 17 07:36:39 PST 2025


================
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Host_Windows_PseudoConsole_H_
+#define liblldb_Host_Windows_PseudoConsole_H_
+
+#include "llvm/Support/Error.h"
+#include <string>
+
+#define PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE 0x20016
+
+namespace lldb_private {
+
+class PseudoConsole {
+
+public:
+  llvm::Error OpenPseudoConsole();
+
+  /// Close the ConPTY, its read/write handles and invalidate them.
+  void Close();
+
+  /// The ConPTY HPCON handle accessor.
+  ///
+  /// This object retains ownership of the HPCON when this accessor is used.
+  ///
+  /// \return
+  ///     The ConPTY HPCON handle, or INVALID_HANDLE_VALUE if it is currently
+  ///     invalid.
+  void *GetPseudoTerminalHandle() { return m_conpty_handle; };
----------------
charles-zablit wrote:

I forward declared `HANDLE` and `HPCON` to replace the `void *`:

```cpp
typedef void *HANDLE;
typedef void *HPCON;
```

https://github.com/llvm/llvm-project/pull/168729


More information about the lldb-commits mailing list