LLDB  mainline
Public Types | Public Member Functions | Protected Attributes | 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::PythonCode, Type::Other
}
 

Public Member Functions

 IOHandler (Debugger &debugger, IOHandler::Type type)
 
 IOHandler (Debugger &debugger, IOHandler::Type type, const lldb::StreamFileSP &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 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::StreamFileSP & GetInputStreamFile ()
 
lldb::StreamFileSP & GetOutputStreamFile ()
 
lldb::StreamFileSP & GetErrorStreamFile ()
 
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::StreamFileSP 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
 

Detailed Description

Definition at line 42 of file IOHandler.h.

Member Enumeration Documentation

◆ Type

Enumerator
CommandInterpreter 
CommandList 
Confirm 
Curses 
Expression 
REPL 
ProcessIO 
PythonInterpreter 
PythonCode 
Other 

Definition at line 44 of file IOHandler.h.

Constructor & Destructor Documentation

◆ IOHandler() [1/2]

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

Definition at line 74 of file IOHandler.cpp.

◆ IOHandler() [2/2]

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

◆ ~IOHandler()

IOHandler::~IOHandler ( )
virtualdefault

Referenced by IOHandler().

Member Function Documentation

◆ Activate()

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

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

◆ GetControlSequence()

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

◆ GetDebugger()

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

◆ GetErrorFD()

int IOHandler::GetErrorFD ( )

Definition at line 108 of file IOHandler.cpp.

References m_error_sp.

◆ GetErrorFILE()

FILE * IOHandler::GetErrorFILE ( )

Definition at line 120 of file IOHandler.cpp.

References m_error_sp.

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

◆ GetErrorStreamFile()

StreamFileSP & IOHandler::GetErrorStreamFile ( )

◆ GetFlags() [1/2]

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

◆ GetFlags() [2/2]

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

Definition at line 139 of file IOHandler.h.

◆ GetHelpPrologue()

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

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 111 of file IOHandler.h.

◆ GetInputFD()

int IOHandler::GetInputFD ( )

Definition at line 100 of file IOHandler.cpp.

References m_input_sp.

◆ GetInputFILE()

FILE * IOHandler::GetInputFILE ( )

◆ GetInputStreamFile()

StreamFileSP & IOHandler::GetInputStreamFile ( )

Definition at line 124 of file IOHandler.cpp.

References m_input_sp.

Referenced by GetIsInteractive(), and GetIsRealTerminal().

◆ GetIsDone()

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

Definition at line 88 of file IOHandler.h.

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

References GetInputStreamFile().

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

References GetInputStreamFile().

◆ GetOutputFD()

int IOHandler::GetOutputFD ( )

Definition at line 104 of file IOHandler.cpp.

References m_output_sp.

◆ GetOutputFILE()

FILE * IOHandler::GetOutputFILE ( )

◆ GetOutputStreamFile()

StreamFileSP & IOHandler::GetOutputStreamFile ( )

◆ GetPrompt()

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

◆ GetType()

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

Definition at line 90 of file IOHandler.h.

◆ 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

◆ 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]

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

Reimplemented in lldb_private::IOHandlerEditline.

Definition at line 101 of file IOHandler.h.

◆ SetPrompt() [2/2]

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

◆ SetUserData()

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

Definition at line 135 of file IOHandler.h.

◆ WaitForPop()

void IOHandler::WaitForPop ( )

Definition at line 140 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 176 of file IOHandler.h.

◆ m_data_recorder

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

Definition at line 170 of file IOHandler.h.

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

◆ m_debugger

Debugger& lldb_private::IOHandler::m_debugger
protected

◆ m_done

bool lldb_private::IOHandler::m_done
protected

Definition at line 175 of file IOHandler.h.

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

◆ m_error_sp

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

Definition at line 169 of file IOHandler.h.

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

◆ m_flags

Flags lldb_private::IOHandler::m_flags
protected

Definition at line 172 of file IOHandler.h.

◆ m_input_sp

lldb::StreamFileSP lldb_private::IOHandler::m_input_sp
protected

◆ m_output_sp

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

Definition at line 168 of file IOHandler.h.

Referenced by GetOutputFD(), GetOutputFILE(), GetOutputStreamFile(), and IOHandler().

◆ m_popped

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

Definition at line 171 of file IOHandler.h.

Referenced by SetPopped(), and WaitForPop().

◆ m_type

Type lldb_private::IOHandler::m_type
protected

Definition at line 173 of file IOHandler.h.

Referenced by curses::Menu::GetType().

◆ m_user_data

void* lldb_private::IOHandler::m_user_data
protected

Definition at line 174 of file IOHandler.h.


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