LLDB mainline
IOHandlerProcessSTDIOWindows Class Reference

#include <IOHandlerProcessSTDIOWindows.h>

Inheritance diagram for IOHandlerProcessSTDIOWindows:
[legend]

Public Member Functions

 IOHandlerProcessSTDIOWindows (Process *process)
 ~IOHandlerProcessSTDIOWindows () override
void SetIsRunning (bool running)
llvm::Expected< boolConsoleHasTextInput (const HANDLE hStdin)
 Peek the console for input.
void Run () override
void Cancel () override
bool Interrupt () override
void GotEOF () override
Public Member Functions inherited from lldb_private::IOHandler
 IOHandler (Debugger &debugger, IOHandler::Type type)
 IOHandler (Debugger &debugger, IOHandler::Type type, const lldb::FileSP &input_sp, const lldb::LockableStreamFileSP &output_sp, const lldb::LockableStreamFileSP &error_sp, uint32_t flags)
virtual ~IOHandler ()
bool IsActive ()
void SetIsDone (bool b)
bool GetIsDone ()
Type GetType () const
virtual void Activate ()
virtual void Deactivate ()
virtual void TerminalSizeChanged ()
virtual void Refresh ()
virtual const char * GetPrompt ()
virtual bool SetPrompt (llvm::StringRef prompt)
virtual bool SetUseColor (bool use_color)
bool SetPrompt (const char *)=delete
virtual llvm::StringRef GetControlSequence (char ch)
virtual const char * GetCommandPrefix ()
virtual const char * GetHelpPrologue ()
int GetInputFD ()
int GetOutputFD ()
int GetErrorFD ()
lldb::FileSP GetInputFileSP ()
lldb::LockableStreamFileSP GetOutputStreamFileSP ()
lldb::LockableStreamFileSP GetErrorStreamFileSP ()
DebuggerGetDebugger ()
void * GetUserData ()
void SetUserData (void *user_data)
FlagsGetFlags ()
const FlagsGetFlags () const
bool GetIsInteractive ()
 Check if the input is being supplied interactively by a user.
bool GetIsRealTerminal ()
 Check if the input is coming from a real terminal.
void SetPopped (bool b)
void WaitForPop ()
virtual void PrintAsync (const char *s, size_t len, bool is_stdout)

Private Types

enum  ControlOp : char { eControlOpQuit = 'q' , eControlOpInterrupt = 'i' , eControlOpNone = 0 }

Private Attributes

Processm_process
NativeFile m_read_file
 Read from this file (usually actual STDIN for LLDB)
HANDLE m_interrupt_event
std::atomic< ControlOpm_pending_op {eControlOpNone}
std::mutex m_mutex
bool m_is_running = false

Additional Inherited Members

Public Types inherited from lldb_private::IOHandler
enum class  Type {
  CommandInterpreter , CommandList , Confirm , Curses ,
  Expression , REPL , ProcessIO , PythonInterpreter ,
  LuaInterpreter , PythonCode , Other
}
Protected Attributes inherited from lldb_private::IOHandler
Debuggerm_debugger
lldb::FileSP m_input_sp
lldb::LockableStreamFileSP m_output_sp
lldb::LockableStreamFileSP m_error_sp
Predicate< boolm_popped
Flags m_flags
Type m_type
void * m_user_data
bool m_done
bool m_active

Detailed Description

Definition at line 20 of file IOHandlerProcessSTDIOWindows.h.

Member Enumeration Documentation

◆ ControlOp

Enumerator
eControlOpQuit 
eControlOpInterrupt 
eControlOpNone 

Definition at line 47 of file IOHandlerProcessSTDIOWindows.h.

Constructor & Destructor Documentation

◆ IOHandlerProcessSTDIOWindows()

◆ ~IOHandlerProcessSTDIOWindows()

IOHandlerProcessSTDIOWindows::~IOHandlerProcessSTDIOWindows ( )
override

Definition at line 26 of file IOHandlerProcessSTDIOWindows.cpp.

References m_interrupt_event.

Member Function Documentation

◆ Cancel()

void IOHandlerProcessSTDIOWindows::Cancel ( )
overridevirtual

◆ ConsoleHasTextInput()

llvm::Expected< bool > IOHandlerProcessSTDIOWindows::ConsoleHasTextInput ( const HANDLE hStdin)

Peek the console for input.

If it has any, drain the pipe until text input is found or the pipe is empty.

Parameters
hStdinThe handle to the standard input's pipe.
Returns
true if the pipe has text input.

Definition at line 46 of file IOHandlerProcessSTDIOWindows.cpp.

Referenced by Run().

◆ GotEOF()

void IOHandlerProcessSTDIOWindows::GotEOF ( )
inlineoverridevirtual

Implements lldb_private::IOHandler.

Definition at line 44 of file IOHandlerProcessSTDIOWindows.h.

◆ Interrupt()

bool IOHandlerProcessSTDIOWindows::Interrupt ( )
overridevirtual

◆ Run()

◆ SetIsRunning()

void IOHandlerProcessSTDIOWindows::SetIsRunning ( bool running)

Definition at line 31 of file IOHandlerProcessSTDIOWindows.cpp.

References m_is_running, m_mutex, and lldb_private::IOHandler::SetIsDone().

Referenced by Run().

Member Data Documentation

◆ m_interrupt_event

HANDLE IOHandlerProcessSTDIOWindows::m_interrupt_event
private
Initial value:
=
reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1))
void * HANDLE

Definition at line 56 of file IOHandlerProcessSTDIOWindows.h.

Referenced by Cancel(), Interrupt(), IOHandlerProcessSTDIOWindows(), Run(), and ~IOHandlerProcessSTDIOWindows().

◆ m_is_running

bool IOHandlerProcessSTDIOWindows::m_is_running = false
private

Definition at line 60 of file IOHandlerProcessSTDIOWindows.h.

Referenced by Cancel(), and SetIsRunning().

◆ m_mutex

std::mutex IOHandlerProcessSTDIOWindows::m_mutex
private

Definition at line 59 of file IOHandlerProcessSTDIOWindows.h.

Referenced by Cancel(), Run(), and SetIsRunning().

◆ m_pending_op

std::atomic<ControlOp> IOHandlerProcessSTDIOWindows::m_pending_op {eControlOpNone}
private

Definition at line 58 of file IOHandlerProcessSTDIOWindows.h.

Referenced by Cancel(), Interrupt(), and Run().

◆ m_process

Process* IOHandlerProcessSTDIOWindows::m_process
private

Definition at line 53 of file IOHandlerProcessSTDIOWindows.h.

Referenced by Interrupt(), IOHandlerProcessSTDIOWindows(), and Run().

◆ m_read_file

NativeFile IOHandlerProcessSTDIOWindows::m_read_file
private

Read from this file (usually actual STDIN for LLDB)

Definition at line 55 of file IOHandlerProcessSTDIOWindows.h.

Referenced by IOHandlerProcessSTDIOWindows(), and Run().


The documentation for this class was generated from the following files: