LLDB mainline
IOHandlerProcessSTDIOWindows.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_PLUGINS_PROCESS_WINDOWS_COMMON_IO_HANDLER_PROCESS_STDIO_WINDOWS_H_
10#define LIBLLDB_PLUGINS_PROCESS_WINDOWS_COMMON_IO_HANDLER_PROCESS_STDIO_WINDOWS_H_
11
12#include "lldb/Core/IOHandler.h"
13#include "lldb/Host/File.h"
14#include "lldb/Target/Process.h"
15
16using HANDLE = void *;
17
18using namespace lldb_private;
19
21public:
23
25
26 void SetIsRunning(bool running);
27
28 /// Peek the console for input. If it has any, drain the pipe until text input
29 /// is found or the pipe is empty.
30 ///
31 /// \param hStdin
32 /// The handle to the standard input's pipe.
33 ///
34 /// \return
35 /// true if the pipe has text input.
36 llvm::Expected<bool> ConsoleHasTextInput(const HANDLE hStdin);
37
38 void Run() override;
39
40 void Cancel() override;
41
42 bool Interrupt() override;
43
44 void GotEOF() override {}
45
46private:
52
54 /// Read from this file (usually actual STDIN for LLDB)
57 reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
58 std::atomic<ControlOp> m_pending_op{eControlOpNone};
59 std::mutex m_mutex;
60 bool m_is_running = false;
61};
62
63#endif // LIBLLDB_PLUGINS_PROCESS_WINDOWS_COMMON_IO_HANDLER_PROCESS_STDIO_WINDOWS_H_
void * HANDLE
llvm::Expected< bool > ConsoleHasTextInput(const HANDLE hStdin)
Peek the console for input.
NativeFile m_read_file
Read from this file (usually actual STDIN for LLDB)
IOHandler(Debugger &debugger, IOHandler::Type type)
Definition IOHandler.cpp:55
A plug-in interface definition class for debugging a process.
Definition Process.h:357
A class that represents a running process on the host machine.
NativeFilePosix NativeFile
Definition File.h:29