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]

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::StreamFileSP &output_sp, const lldb::StreamFileSP &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 const char * GetPrompt ()
 
virtual bool SetPrompt (llvm::StringRef prompt)
 
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 ()
 
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.
 
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)
 
std::recursive_mutex & GetOutputMutex ()
 

Protected Attributes

Debuggerm_debugger
 
lldb::FileSP m_input_sp
 
lldb::StreamFileSP m_output_sp
 
lldb::StreamFileSP m_error_sp
 
std::recursive_mutex m_output_mutex
 
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 43 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 45 of file IOHandler.h.

Constructor & Destructor Documentation

◆ IOHandler() [1/3]

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

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

◆ ~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 92 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 llvm::StringRef lldb_private::IOHandler::GetControlSequence ( char  ch)
inlinevirtual

◆ GetDebugger()

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

◆ GetErrorFD()

int IOHandler::GetErrorFD ( )

Definition at line 87 of file IOHandler.cpp.

References m_error_sp.

◆ GetErrorFILE()

FILE * IOHandler::GetErrorFILE ( )

Definition at line 99 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 139 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 141 of file IOHandler.h.

References m_flags.

◆ GetHelpPrologue()

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

◆ GetInputFD()

int IOHandler::GetInputFD ( )

Definition at line 79 of file IOHandler.cpp.

References m_input_sp.

◆ GetInputFILE()

FILE * IOHandler::GetInputFILE ( )

◆ GetInputFileSP()

FileSP IOHandler::GetInputFileSP ( )

Definition at line 103 of file IOHandler.cpp.

References m_input_sp.

Referenced by GetIsInteractive(), and GetIsRealTerminal().

◆ GetIsDone()

bool lldb_private::IOHandler::GetIsDone ( )
inline

Definition at line 88 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 109 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 113 of file IOHandler.cpp.

References GetInputFileSP().

◆ GetOutputFD()

int IOHandler::GetOutputFD ( )

Definition at line 83 of file IOHandler.cpp.

References m_output_sp.

◆ GetOutputFILE()

FILE * IOHandler::GetOutputFILE ( )

Definition at line 95 of file IOHandler.cpp.

References m_output_sp.

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

◆ GetOutputMutex()

std::recursive_mutex & lldb_private::IOHandler::GetOutputMutex ( )
inline

◆ GetOutputStreamFileSP()

StreamFileSP IOHandler::GetOutputStreamFileSP ( )

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

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 84 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()

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

◆ Run()

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

◆ SetIsDone()

void lldb_private::IOHandler::SetIsDone ( bool  b)
inline

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

◆ SetUserData()

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

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

◆ WaitForPop()

void IOHandler::WaitForPop ( )

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

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

◆ m_debugger

Debugger& lldb_private::IOHandler::m_debugger
protected

Definition at line 167 of file IOHandler.h.

Referenced by GetDebugger(), and lldb_private::IOHandlerEditline::SetPrompt().

◆ m_done

bool lldb_private::IOHandler::m_done
protected

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

◆ m_flags

Flags lldb_private::IOHandler::m_flags
protected

Definition at line 173 of file IOHandler.h.

Referenced by GetFlags().

◆ m_input_sp

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

◆ m_output_mutex

std::recursive_mutex lldb_private::IOHandler::m_output_mutex
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 172 of file IOHandler.h.

Referenced by SetPopped(), and WaitForPop().

◆ m_type

Type lldb_private::IOHandler::m_type
protected

Definition at line 174 of file IOHandler.h.

Referenced by GetType().

◆ m_user_data

void* lldb_private::IOHandler::m_user_data
protected

Definition at line 175 of file IOHandler.h.

Referenced by GetUserData(), and SetUserData().


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