LLDB  mainline
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
lldb_private::IOHandler Class Referenceabstract

#include <IOHandler.h>

Inheritance diagram for lldb_private::IOHandler:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::IOHandler:
Collaboration graph
[legend]

Public Types

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

Public Member Functions

 IOHandler (Debugger &debugger, IOHandler::Type type)
 
 IOHandler (Debugger &debugger, IOHandler::Type type, const lldb::FileSP &input_sp, const lldb::StreamFileSP &output_sp, const lldb::StreamFileSP &error_sp, uint32_t flags, repro::DataRecorder *data_recorder)
 
virtual ~IOHandler ()
 
virtual void Run ()=0
 
virtual void Cancel ()=0
 
virtual bool Interrupt ()=0
 
virtual void GotEOF ()=0
 
virtual bool IsActive ()
 
virtual void SetIsDone (bool b)
 
virtual bool GetIsDone ()
 
Type GetType () const
 
virtual void Activate ()
 
virtual void Deactivate ()
 
virtual void TerminalSizeChanged ()
 
virtual const char * GetPrompt ()
 
virtual bool SetPrompt (llvm::StringRef prompt)
 
bool SetPrompt (const char *)=delete
 
virtual ConstString GetControlSequence (char ch)
 
virtual const char * GetCommandPrefix ()
 
virtual const char * GetHelpPrologue ()
 
int GetInputFD ()
 
int GetOutputFD ()
 
int GetErrorFD ()
 
FILE * GetInputFILE ()
 
FILE * GetOutputFILE ()
 
FILE * GetErrorFILE ()
 
lldb::FileSP GetInputFileSP ()
 
lldb::StreamFileSP GetOutputStreamFileSP ()
 
lldb::StreamFileSP 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. More...
 
bool GetIsRealTerminal ()
 Check if the input is coming from a real terminal. More...
 
void SetPopped (bool b)
 
void WaitForPop ()
 
virtual void PrintAsync (Stream *stream, const char *s, size_t len)
 

Protected Attributes

Debuggerm_debugger
 
lldb::FileSP m_input_sp
 
lldb::StreamFileSP m_output_sp
 
lldb::StreamFileSP m_error_sp
 
repro::DataRecorderm_data_recorder
 
Predicate< bool > m_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 46 of file IOHandler.h.

Member Enumeration Documentation

◆ Type

Enumerator
CommandInterpreter 
CommandList 
Confirm 
Curses 
Expression 
REPL 
ProcessIO 
PythonInterpreter 
LuaInterpreter 
PythonCode 
Other 

Definition at line 48 of file IOHandler.h.

Constructor & Destructor Documentation

◆ IOHandler() [1/3]

IOHandler::IOHandler ( Debugger debugger,
IOHandler::Type  type 
)

Definition at line 56 of file IOHandler.cpp.

◆ IOHandler() [2/3]

IOHandler::IOHandler ( Debugger debugger,
IOHandler::Type  type,
const lldb::FileSP &  input_sp,
const lldb::StreamFileSP &  output_sp,
const lldb::StreamFileSP &  error_sp,
uint32_t  flags,
repro::DataRecorder data_recorder 
)

◆ ~IOHandler()

IOHandler::~IOHandler ( )
virtualdefault

◆ IOHandler() [3/3]

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

Member Function Documentation

◆ Activate()

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

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

Definition at line 96 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

◆ GetControlSequence()

virtual ConstString lldb_private::IOHandler::GetControlSequence ( char  ch)
inlinevirtual

◆ GetDebugger()

Debugger& lldb_private::IOHandler::GetDebugger ( )
inline

◆ GetErrorFD()

int IOHandler::GetErrorFD ( )

Definition at line 90 of file IOHandler.cpp.

References m_error_sp.

◆ GetErrorFILE()

FILE * IOHandler::GetErrorFILE ( )

Definition at line 102 of file IOHandler.cpp.

References m_error_sp.

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

◆ GetErrorStreamFileSP()

StreamFileSP IOHandler::GetErrorStreamFileSP ( )

◆ GetFlags() [1/2]

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

Definition at line 143 of file IOHandler.h.

References m_flags.

◆ GetFlags() [2/2]

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

Definition at line 145 of file IOHandler.h.

References m_flags.

◆ GetHelpPrologue()

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

◆ GetInputFD()

int IOHandler::GetInputFD ( )

Definition at line 82 of file IOHandler.cpp.

References m_input_sp.

◆ GetInputFILE()

FILE * IOHandler::GetInputFILE ( )

◆ GetInputFileSP()

FileSP IOHandler::GetInputFileSP ( )

Definition at line 106 of file IOHandler.cpp.

References m_input_sp.

Referenced by GetIsInteractive(), and GetIsRealTerminal().

◆ GetIsDone()

virtual bool lldb_private::IOHandler::GetIsDone ( )
inlinevirtual

Definition at line 92 of file IOHandler.h.

References m_done.

◆ 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 112 of file IOHandler.cpp.

References GetInputFileSP().

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

◆ 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 116 of file IOHandler.cpp.

References GetInputFileSP().

◆ GetOutputFD()

int IOHandler::GetOutputFD ( )

Definition at line 86 of file IOHandler.cpp.

References m_output_sp.

◆ GetOutputFILE()

FILE * IOHandler::GetOutputFILE ( )

Definition at line 98 of file IOHandler.cpp.

References m_output_sp.

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

◆ GetOutputStreamFileSP()

StreamFileSP IOHandler::GetOutputStreamFileSP ( )

◆ GetPrompt()

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

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 102 of file IOHandler.h.

◆ GetType()

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

Definition at line 94 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()

virtual bool lldb_private::IOHandler::IsActive ( )
inlinevirtual

Definition at line 88 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

◆ PrintAsync()

virtual void lldb_private::IOHandler::PrintAsync ( Stream stream,
const char *  s,
size_t  len 
)
inlinevirtual

◆ Run()

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

◆ SetIsDone()

virtual void lldb_private::IOHandler::SetIsDone ( bool  b)
inlinevirtual

◆ SetPopped()

void IOHandler::SetPopped ( bool  b)

◆ 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 107 of file IOHandler.h.

◆ SetUserData()

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

Definition at line 141 of file IOHandler.h.

References m_user_data.

◆ TerminalSizeChanged()

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

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

Definition at line 100 of file IOHandler.h.

◆ WaitForPop()

void IOHandler::WaitForPop ( )

Definition at line 122 of file IOHandler.cpp.

References m_popped, and lldb_private::Predicate< T >::WaitForValueEqualTo().

Member Data Documentation

◆ m_active

bool lldb_private::IOHandler::m_active
protected

Definition at line 182 of file IOHandler.h.

Referenced by Activate(), Deactivate(), and IsActive().

◆ m_data_recorder

repro::DataRecorder* lldb_private::IOHandler::m_data_recorder
protected

Definition at line 176 of file IOHandler.h.

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

◆ m_debugger

Debugger& lldb_private::IOHandler::m_debugger
protected

Definition at line 172 of file IOHandler.h.

Referenced by GetDebugger().

◆ m_done

bool lldb_private::IOHandler::m_done
protected

Definition at line 181 of file IOHandler.h.

Referenced by GetIsDone(), IsActive(), lldb_private::IOHandlerEditline::Run(), and SetIsDone().

◆ m_error_sp

lldb::StreamFileSP lldb_private::IOHandler::m_error_sp
protected

Definition at line 175 of file IOHandler.h.

Referenced by GetErrorFD(), GetErrorFILE(), GetErrorStreamFileSP(), and IOHandler().

◆ m_flags

Flags lldb_private::IOHandler::m_flags
protected

Definition at line 178 of file IOHandler.h.

Referenced by GetFlags().

◆ m_input_sp

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

◆ m_output_sp

lldb::StreamFileSP lldb_private::IOHandler::m_output_sp
protected

◆ m_popped

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

Definition at line 177 of file IOHandler.h.

Referenced by SetPopped(), and WaitForPop().

◆ m_type

Type lldb_private::IOHandler::m_type
protected

Definition at line 179 of file IOHandler.h.

Referenced by GetType().

◆ m_user_data

void* lldb_private::IOHandler::m_user_data
protected

Definition at line 180 of file IOHandler.h.

Referenced by GetUserData(), and SetUserData().


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