LLDB mainline
|
#include <IOHandler.h>
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 () |
Debugger & | GetDebugger () |
void * | GetUserData () |
void | SetUserData (void *user_data) |
Flags & | GetFlags () |
const Flags & | GetFlags () 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 | |
Debugger & | m_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 IOHandler & | operator= (const IOHandler &)=delete |
Definition at line 42 of file IOHandler.h.
|
strong |
Enumerator | |
---|---|
CommandInterpreter | |
CommandList | |
Confirm | |
Curses | |
Expression | |
REPL | |
ProcessIO | |
PythonInterpreter | |
LuaInterpreter | |
PythonCode | |
Other |
Definition at line 44 of file IOHandler.h.
IOHandler::IOHandler | ( | Debugger & | debugger, |
IOHandler::Type | type | ||
) |
Definition at line 55 of file IOHandler.cpp.
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 | ||
) |
Definition at line 64 of file IOHandler.cpp.
References lldb_private::Debugger::AdoptTopIOHandlerFilesIfInvalid(), m_error_sp, m_input_sp, and m_output_sp.
|
virtualdefault |
|
privatedelete |
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline, and lldb_private::IOHandlerCursesGUI.
Definition at line 91 of file IOHandler.h.
References m_active.
Referenced by lldb_private::IOHandlerEditline::Activate().
|
pure virtual |
Implemented in lldb_private::IOHandlerEditline, lldb_private::IOHandlerCursesGUI, and IOHandlerProcessSTDIO.
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline, and lldb_private::IOHandlerCursesGUI.
Definition at line 93 of file IOHandler.h.
References m_active.
Referenced by lldb_private::IOHandlerEditline::Deactivate().
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 110 of file IOHandler.h.
Referenced by lldb_private::IOHandlerStack::GetTopIOHandlerCommandPrefix().
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 108 of file IOHandler.h.
Referenced by lldb_private::IOHandlerStack::GetTopIOHandlerControlSequence().
|
inline |
Definition at line 132 of file IOHandler.h.
References m_debugger.
Referenced by lldb_private::IOHandlerDelegate::IOHandlerComplete(), lldb_private::REPL::IOHandlerFixIndentation(), and lldb_private::IOHandlerDelegate::IOHandlerSuggestion().
int IOHandler::GetErrorFD | ( | ) |
Definition at line 87 of file IOHandler.cpp.
References m_error_sp.
FILE * IOHandler::GetErrorFILE | ( | ) |
Definition at line 99 of file IOHandler.cpp.
References m_error_sp.
Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().
StreamFileSP IOHandler::GetErrorStreamFileSP | ( | ) |
Definition at line 107 of file IOHandler.cpp.
References m_error_sp.
Referenced by lldb_private::REPL::IOHandlerActivated(), CommandObjectCommandsScriptAdd::IOHandlerInputComplete(), CommandObjectTypeSummaryAdd::IOHandlerInputComplete(), CommandObjectTypeSynthAdd::IOHandlerInputComplete(), IOHandlerLuaInterpreter::IOHandlerInputComplete(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::CommandInterpreter::PrintCommandOutput().
|
inline |
Definition at line 138 of file IOHandler.h.
References m_flags.
Referenced by lldb_private::CommandInterpreter::IOHandlerInputComplete().
|
inline |
Definition at line 140 of file IOHandler.h.
References m_flags.
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 112 of file IOHandler.h.
Referenced by lldb_private::IOHandlerStack::GetTopIOHandlerHelpPrologue().
int IOHandler::GetInputFD | ( | ) |
Definition at line 79 of file IOHandler.cpp.
References m_input_sp.
FILE * IOHandler::GetInputFILE | ( | ) |
Definition at line 91 of file IOHandler.cpp.
References m_input_sp.
Referenced by lldb_private::IOHandlerEditline::GetLine(), and lldb_private::IOHandlerEditline::IOHandlerEditline().
FileSP IOHandler::GetInputFileSP | ( | ) |
Definition at line 103 of file IOHandler.cpp.
References m_input_sp.
Referenced by GetIsInteractive(), and GetIsRealTerminal().
|
inline |
Definition at line 87 of file IOHandler.h.
References m_done.
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().
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().
int IOHandler::GetOutputFD | ( | ) |
Definition at line 83 of file IOHandler.cpp.
References m_output_sp.
FILE * IOHandler::GetOutputFILE | ( | ) |
Definition at line 95 of file IOHandler.cpp.
References m_output_sp.
Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline().
|
inline |
Definition at line 163 of file IOHandler.h.
References m_output_mutex.
Referenced by lldb_private::IOHandlerEditline::IOHandlerEditline(), lldb_private::CommandInterpreter::IOHandlerInputComplete(), and lldb_private::CommandInterpreter::PrintCommandOutput().
StreamFileSP IOHandler::GetOutputStreamFileSP | ( | ) |
Definition at line 105 of file IOHandler.cpp.
References m_output_sp.
Referenced by CommandObjectCommandsScriptAdd::IOHandlerActivated(), CommandObjectTypeSummaryAdd::IOHandlerActivated(), CommandObjectTypeSynthAdd::IOHandlerActivated(), IOHandlerLuaInterpreter::IOHandlerActivated(), CommandObjectCommandsAddRegex::IOHandlerInputComplete(), lldb_private::REPL::IOHandlerInputComplete(), lldb_private::CommandInterpreter::IOHandlerInputComplete(), and lldb_private::CommandInterpreter::PrintCommandOutput().
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 97 of file IOHandler.h.
Referenced by lldb_private::CommandInterpreter::IOHandlerInputComplete().
|
inline |
Definition at line 89 of file IOHandler.h.
References m_type.
|
inline |
Definition at line 134 of file IOHandler.h.
References m_user_data.
Referenced by CommandObjectTypeSummaryAdd::IOHandlerInputComplete(), CommandObjectTypeSynthAdd::IOHandlerInputComplete(), and IOHandlerLuaInterpreter::IOHandlerInputComplete().
|
pure virtual |
Implemented in lldb_private::IOHandlerEditline, lldb_private::IOHandlerCursesGUI, and IOHandlerProcessSTDIO.
|
pure virtual |
Implemented in lldb_private::IOHandlerEditline, lldb_private::IOHandlerCursesGUI, and IOHandlerProcessSTDIO.
|
inline |
Definition at line 83 of file IOHandler.h.
References m_active, and m_done.
Referenced by lldb_private::IOHandlerEditline::Run().
|
virtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 121 of file IOHandler.cpp.
References m_error_sp, m_output_mutex, and m_output_sp.
Referenced by lldb_private::IOHandlerStack::PrintAsync(), and lldb_private::IOHandlerEditline::PrintAsync().
|
pure virtual |
Implemented in lldb_private::IOHandlerEditline, lldb_private::IOHandlerCursesGUI, and IOHandlerProcessSTDIO.
|
inline |
Definition at line 85 of file IOHandler.h.
References m_done.
Referenced by lldb_private::IOHandlerEditline::GetLine(), lldb_private::REPL::IOHandlerActivated(), lldb_private::IOHandlerConfirm::IOHandlerInputComplete(), CommandObjectCommandsScriptAdd::IOHandlerInputComplete(), CommandObjectTypeSummaryAdd::IOHandlerInputComplete(), CommandObjectTypeSynthAdd::IOHandlerInputComplete(), IOHandlerLuaInterpreter::IOHandlerInputComplete(), lldb_private::REPL::IOHandlerInputComplete(), and lldb_private::CommandInterpreter::IOHandlerInputComplete().
void IOHandler::SetPopped | ( | bool | b | ) |
Definition at line 117 of file IOHandler.cpp.
References lldb_private::eBroadcastOnChange, m_popped, and lldb_private::Predicate< T >::SetValue().
|
delete |
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline.
Definition at line 102 of file IOHandler.h.
|
inline |
Definition at line 136 of file IOHandler.h.
References m_user_data.
|
inlinevirtual |
Reimplemented in lldb_private::IOHandlerEditline, and lldb_private::IOHandlerCursesGUI.
Definition at line 95 of file IOHandler.h.
void IOHandler::WaitForPop | ( | ) |
Definition at line 119 of file IOHandler.cpp.
References m_popped, and lldb_private::Predicate< T >::WaitForValueEqualTo().
|
protected |
Definition at line 176 of file IOHandler.h.
Referenced by Activate(), Deactivate(), and IsActive().
|
protected |
Definition at line 166 of file IOHandler.h.
Referenced by GetDebugger(), and lldb_private::IOHandlerEditline::SetPrompt().
|
protected |
Definition at line 175 of file IOHandler.h.
Referenced by GetIsDone(), IsActive(), lldb_private::IOHandlerEditline::Run(), and SetIsDone().
|
protected |
Definition at line 169 of file IOHandler.h.
Referenced by GetErrorFD(), GetErrorFILE(), GetErrorStreamFileSP(), IOHandler(), PrintAsync(), and lldb_private::IOHandlerEditline::PrintAsync().
|
protected |
Definition at line 172 of file IOHandler.h.
Referenced by GetFlags().
|
protected |
Definition at line 167 of file IOHandler.h.
Referenced by GetInputFD(), GetInputFILE(), GetInputFileSP(), lldb_private::IOHandlerEditline::GetLine(), IOHandler(), and lldb_private::IOHandlerEditline::IOHandlerEditline().
|
protected |
Definition at line 170 of file IOHandler.h.
Referenced by GetOutputMutex(), PrintAsync(), and lldb_private::IOHandlerEditline::PrintAsync().
|
protected |
Definition at line 168 of file IOHandler.h.
Referenced by lldb_private::IOHandlerEditline::GetLine(), lldb_private::IOHandlerEditline::GetLines(), GetOutputFD(), GetOutputFILE(), GetOutputStreamFileSP(), IOHandler(), PrintAsync(), and lldb_private::IOHandlerEditline::PrintAsync().
|
protected |
Definition at line 171 of file IOHandler.h.
Referenced by SetPopped(), and WaitForPop().
|
protected |
Definition at line 173 of file IOHandler.h.
Referenced by GetType().
|
protected |
Definition at line 174 of file IOHandler.h.
Referenced by GetUserData(), and SetUserData().