LLDB mainline
lldb_private::IOHandler Class Referenceabstract

#include <IOHandler.h>

Inheritance diagram for lldb_private::IOHandler:
[legend]

Public Types

enum class  Type {
  CommandInterpreter , CommandList , Confirm , Curses ,
  Expression , REPL , ProcessIO , PythonInterpreter ,
  LuaInterpreter , PythonCode , Other
}

Public Member Functions

 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 ()
virtual void Run ()=0
virtual void Cancel ()=0
virtual bool Interrupt ()=0
virtual void GotEOF ()=0
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

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

Private Member Functions

 IOHandler (const IOHandler &)=delete
const IOHandleroperator= (const IOHandler &)=delete

Detailed Description

Definition at line 37 of file IOHandler.h.

Member Enumeration Documentation

◆ Type

enum class lldb_private::IOHandler::Type
strong
Enumerator
CommandInterpreter 
CommandList 
Confirm 
Curses 
Expression 
REPL 
ProcessIO 
PythonInterpreter 
LuaInterpreter 
PythonCode 
Other 

Definition at line 39 of file IOHandler.h.

Constructor & Destructor Documentation

◆ IOHandler() [1/3]

◆ IOHandler() [2/3]

IOHandler::IOHandler ( Debugger & debugger,
IOHandler::Type type,
const lldb::FileSP & input_sp,
const lldb::LockableStreamFileSP & output_sp,
const lldb::LockableStreamFileSP & error_sp,
uint32_t flags )

◆ ~IOHandler()

IOHandler::~IOHandler ( )
virtualdefault

◆ IOHandler() [3/3]

lldb_private::IOHandler::IOHandler ( const IOHandler & )
privatedelete

References IOHandler().

Member Function Documentation

◆ Activate()

virtual void lldb_private::IOHandler::Activate ( )
inlinevirtual

Reimplemented in lldb_private::IOHandlerCursesGUI, and lldb_private::IOHandlerEditline.

Definition at line 87 of file IOHandler.h.

References m_active.

Referenced by lldb_private::IOHandlerEditline::Activate().

◆ Cancel()

virtual void lldb_private::IOHandler::Cancel ( )
pure virtual

◆ Deactivate()

virtual void lldb_private::IOHandler::Deactivate ( )
inlinevirtual

◆ GetCommandPrefix()

virtual const char * lldb_private::IOHandler::GetCommandPrefix ( )
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 114 of file IOHandler.h.

◆ GetControlSequence()

virtual llvm::StringRef lldb_private::IOHandler::GetControlSequence ( char ch)
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 112 of file IOHandler.h.

◆ GetDebugger()

◆ GetErrorFD()

int IOHandler::GetErrorFD ( )

Definition at line 87 of file IOHandler.cpp.

References m_error_sp.

◆ GetErrorStreamFileSP()

◆ GetFlags() [1/2]

Flags & lldb_private::IOHandler::GetFlags ( )
inline

Definition at line 136 of file IOHandler.h.

References m_flags.

Referenced by lldb_private::CommandInterpreter::IOHandlerInputComplete().

◆ GetFlags() [2/2]

const Flags & lldb_private::IOHandler::GetFlags ( ) const
inline

Definition at line 138 of file IOHandler.h.

References m_flags.

◆ GetHelpPrologue()

virtual const char * lldb_private::IOHandler::GetHelpPrologue ( )
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 116 of file IOHandler.h.

◆ GetInputFD()

int IOHandler::GetInputFD ( )

Definition at line 79 of file IOHandler.cpp.

References m_input_sp.

Referenced by IOHandlerProcessSTDIO::IOHandlerProcessSTDIO().

◆ GetInputFileSP()

FileSP IOHandler::GetInputFileSP ( )

Definition at line 91 of file IOHandler.cpp.

References m_input_sp.

Referenced by GetIsInteractive(), and GetIsRealTerminal().

◆ GetIsDone()

bool lldb_private::IOHandler::GetIsDone ( )
inline

Definition at line 83 of file IOHandler.h.

References m_done.

Referenced by IOHandlerProcessSTDIO::Run().

◆ GetIsInteractive()

bool IOHandler::GetIsInteractive ( )

Check if the input is being supplied interactively by a user.

This will return true if the input stream is a terminal (tty or pty) and can cause IO handlers to do different things (like for a confirmation when deleting all breakpoints).

Definition at line 97 of file IOHandler.cpp.

References GetInputFileSP().

Referenced by lldb_private::IOHandlerEditline::Activate(), lldb_private::IOHandlerEditline::GetLine(), lldb_private::IOHandlerEditline::GetLines(), and lldb_private::CommandInterpreter::IOHandlerInputComplete().

◆ GetIsRealTerminal()

bool IOHandler::GetIsRealTerminal ( )

Check if the input is coming from a real terminal.

A real terminal has a valid size with a certain number of rows and columns. If this function returns true, then terminal escape sequences are expected to work (cursor movement escape sequences, clearing lines, etc).

Definition at line 101 of file IOHandler.cpp.

References GetInputFileSP().

◆ GetOutputFD()

int IOHandler::GetOutputFD ( )

Definition at line 83 of file IOHandler.cpp.

References m_output_sp.

◆ GetOutputStreamFileSP()

◆ GetPrompt()

virtual const char * lldb_private::IOHandler::GetPrompt ( )
inlinevirtual

◆ GetType()

Type lldb_private::IOHandler::GetType ( ) const
inline

Definition at line 85 of file IOHandler.h.

References m_type.

◆ GetUserData()

void * lldb_private::IOHandler::GetUserData ( )
inline

◆ GotEOF()

virtual void lldb_private::IOHandler::GotEOF ( )
pure virtual

◆ Interrupt()

virtual bool lldb_private::IOHandler::Interrupt ( )
pure virtual

◆ IsActive()

bool lldb_private::IOHandler::IsActive ( )
inline

Definition at line 79 of file IOHandler.h.

References m_active, and m_done.

Referenced by lldb_private::IOHandlerEditline::Run().

◆ operator=()

const IOHandler & lldb_private::IOHandler::operator= ( const IOHandler & )
privatedelete

References IOHandler().

◆ PrintAsync()

void IOHandler::PrintAsync ( const char * s,
size_t len,
bool is_stdout )
virtual

◆ Refresh()

virtual void lldb_private::IOHandler::Refresh ( )
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 93 of file IOHandler.h.

◆ Run()

virtual void lldb_private::IOHandler::Run ( )
pure virtual

◆ SetIsDone()

◆ SetPopped()

void IOHandler::SetPopped ( bool b)

Definition at line 105 of file IOHandler.cpp.

References lldb_private::eBroadcastOnChange, and m_popped.

◆ SetPrompt() [1/2]

bool lldb_private::IOHandler::SetPrompt ( const char * )
delete

◆ SetPrompt() [2/2]

virtual bool lldb_private::IOHandler::SetPrompt ( llvm::StringRef prompt)
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 100 of file IOHandler.h.

◆ SetUseColor()

virtual bool lldb_private::IOHandler::SetUseColor ( bool use_color)
inlinevirtual

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 105 of file IOHandler.h.

◆ SetUserData()

void lldb_private::IOHandler::SetUserData ( void * user_data)
inline

Definition at line 134 of file IOHandler.h.

References m_user_data.

◆ TerminalSizeChanged()

virtual void lldb_private::IOHandler::TerminalSizeChanged ( )
inlinevirtual

Reimplemented in lldb_private::IOHandlerCursesGUI, and lldb_private::IOHandlerEditline.

Definition at line 91 of file IOHandler.h.

◆ WaitForPop()

void IOHandler::WaitForPop ( )

Definition at line 107 of file IOHandler.cpp.

References m_popped.

Member Data Documentation

◆ m_active

bool lldb_private::IOHandler::m_active
protected

◆ m_debugger

Debugger& lldb_private::IOHandler::m_debugger
protected

◆ m_done

bool lldb_private::IOHandler::m_done
protected

◆ m_error_sp

◆ m_flags

Flags lldb_private::IOHandler::m_flags
protected

Definition at line 167 of file IOHandler.h.

Referenced by GetFlags(), GetFlags(), and IOHandler().

◆ m_input_sp

lldb::FileSP lldb_private::IOHandler::m_input_sp
protected

◆ m_output_sp

◆ m_popped

Predicate<bool> lldb_private::IOHandler::m_popped
protected

Definition at line 166 of file IOHandler.h.

Referenced by IOHandler(), SetPopped(), and WaitForPop().

◆ m_type

Type lldb_private::IOHandler::m_type
protected

Definition at line 168 of file IOHandler.h.

Referenced by GetType(), and IOHandler().

◆ m_user_data

void* lldb_private::IOHandler::m_user_data
protected

Definition at line 169 of file IOHandler.h.

Referenced by GetUserData(), IOHandler(), and SetUserData().


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