LLDB mainline
lldb_private::IOHandlerProcessSTDIO Class Reference

Forwards lldb's STDIN to the inferior's pty (or anything writable) and supports asynchronous interrupt via an internal pipe. More...

#include <ProcessIOHandler.h>

Inheritance diagram for lldb_private::IOHandlerProcessSTDIO:
[legend]

Public Member Functions

 IOHandlerProcessSTDIO (Process *process, int write_fd)
 ~IOHandlerProcessSTDIO () override=default
void SetIsRunning (bool running)
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)

Protected Attributes

Processm_process
NativeFile m_read_file
 Read from this file (usually actual STDIN for LLDB)
NativeFile m_write_file
 Write to this file (usually the primary pty for getting io to debuggee)
Pipe m_pipe
std::mutex m_mutex
bool m_is_running = false
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

Additional Inherited Members

Public Types inherited from lldb_private::IOHandler
enum class  Type {
  CommandInterpreter , CommandList , Confirm , Curses ,
  Expression , REPL , ProcessIO , PythonInterpreter ,
  LuaInterpreter , PythonCode , Other
}

Detailed Description

Forwards lldb's STDIN to the inferior's pty (or anything writable) and supports asynchronous interrupt via an internal pipe.

Used on POSIX hosts and as a no-op stub on Windows.

Definition at line 22 of file ProcessIOHandler.h.

Constructor & Destructor Documentation

◆ IOHandlerProcessSTDIO()

◆ ~IOHandlerProcessSTDIO()

lldb_private::IOHandlerProcessSTDIO::~IOHandlerProcessSTDIO ( )
overridedefault

Member Function Documentation

◆ Cancel()

void IOHandlerProcessSTDIO::Cancel ( )
overridevirtual

◆ GotEOF()

void lldb_private::IOHandlerProcessSTDIO::GotEOF ( )
inlineoverridevirtual

Implements lldb_private::IOHandler.

Definition at line 36 of file ProcessIOHandler.h.

◆ Interrupt()

bool IOHandlerProcessSTDIO::Interrupt ( )
overridevirtual

◆ Run()

◆ SetIsRunning()

void IOHandlerProcessSTDIO::SetIsRunning ( bool running)

Definition at line 30 of file ProcessIOHandler.cpp.

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

Referenced by Run().

Member Data Documentation

◆ m_is_running

bool lldb_private::IOHandlerProcessSTDIO::m_is_running = false
protected

Definition at line 46 of file ProcessIOHandler.h.

Referenced by Cancel(), and SetIsRunning().

◆ m_mutex

std::mutex lldb_private::IOHandlerProcessSTDIO::m_mutex
protected

Definition at line 45 of file ProcessIOHandler.h.

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

◆ m_pipe

Pipe lldb_private::IOHandlerProcessSTDIO::m_pipe
protected

Definition at line 44 of file ProcessIOHandler.h.

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

◆ m_process

Process* lldb_private::IOHandlerProcessSTDIO::m_process
protected

Definition at line 39 of file ProcessIOHandler.h.

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

◆ m_read_file

NativeFile lldb_private::IOHandlerProcessSTDIO::m_read_file
protected

Read from this file (usually actual STDIN for LLDB)

Definition at line 41 of file ProcessIOHandler.h.

Referenced by IOHandlerProcessSTDIO(), and Run().

◆ m_write_file

NativeFile lldb_private::IOHandlerProcessSTDIO::m_write_file
protected

Write to this file (usually the primary pty for getting io to debuggee)

Definition at line 43 of file ProcessIOHandler.h.

Referenced by IOHandlerProcessSTDIO(), and Run().


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