LLDB mainline
|
#include <ScriptInterpreter.h>
Public Member Functions | |
~ScriptInterpreterIORedirect () | |
lldb::FileSP | GetInputFile () const |
lldb::FileSP | GetOutputFile () const |
lldb::FileSP | GetErrorFile () const |
void | Flush () |
Flush our output and error file handles. | |
Static Public Member Functions | |
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > | Create (bool enable_io, Debugger &debugger, CommandReturnObject *result) |
Create an IO redirect. | |
Private Member Functions | |
ScriptInterpreterIORedirect (std::unique_ptr< File > input, std::unique_ptr< File > output) | |
ScriptInterpreterIORedirect (Debugger &debugger, CommandReturnObject *result) | |
Private Attributes | |
lldb::FileSP | m_input_file_sp |
lldb::StreamFileSP | m_output_file_sp |
lldb::StreamFileSP | m_error_file_sp |
ThreadedCommunication | m_communication |
bool | m_disconnect |
Definition at line 107 of file ScriptInterpreter.h.
ScriptInterpreterIORedirect::~ScriptInterpreterIORedirect | ( | ) |
Definition at line 259 of file ScriptInterpreter.cpp.
References lldb_private::ThreadedCommunication::Disconnect(), lldb_private::ThreadedCommunication::JoinReadThread(), m_communication, m_disconnect, m_error_file_sp, and m_output_file_sp.
|
private |
Definition at line 200 of file ScriptInterpreter.cpp.
|
private |
Definition at line 208 of file ScriptInterpreter.cpp.
References lldb_private::Debugger::AdoptTopIOHandlerFilesIfInvalid(), lldb_private::PipePosix::CreateNew(), lldb_private::Debugger::GetErrorStream(), lldb_private::StreamFile::GetFileSP(), lldb_private::Debugger::GetInputFileSP(), lldb_private::Debugger::GetOutputStream(), lldb_private::CommandReturnObject::GetOutputStream(), m_communication, m_disconnect, m_error_file_sp, m_input_file_sp, m_output_file_sp, ReadThreadBytesReceived(), lldb_private::PipePosix::ReleaseReadFileDescriptor(), lldb_private::PipePosix::ReleaseWriteFileDescriptor(), lldb_private::ThreadedCommunication::SetConnection(), lldb_private::CommandReturnObject::SetImmediateErrorFile(), lldb_private::CommandReturnObject::SetImmediateOutputFile(), lldb_private::ThreadedCommunication::SetReadThreadBytesReceivedCallback(), and lldb_private::ThreadedCommunication::StartReadThread().
|
static |
Create an IO redirect.
If IO is enabled, this will redirects the output to the command return object if set or to the debugger otherwise. If IO is disabled, it will redirect all IO to /dev/null.
Definition at line 180 of file ScriptInterpreter.cpp.
References lldb_private::FileSystem::DEV_NULL, lldb_private::File::eOpenOptionReadOnly, lldb_private::File::eOpenOptionWriteOnly, lldb_private::FileSystem::Instance(), and lldb_private::FileSystem::Open().
Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().
void ScriptInterpreterIORedirect::Flush | ( | ) |
Flush our output and error file handles.
Definition at line 252 of file ScriptInterpreter.cpp.
References m_error_file_sp, and m_output_file_sp.
Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().
|
inline |
Definition at line 119 of file ScriptInterpreter.h.
References m_error_file_sp.
Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().
|
inline |
Definition at line 117 of file ScriptInterpreter.h.
References m_input_file_sp.
|
inline |
Definition at line 118 of file ScriptInterpreter.h.
References m_output_file_sp.
Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().
|
private |
Definition at line 132 of file ScriptInterpreter.h.
Referenced by ScriptInterpreterIORedirect(), and ~ScriptInterpreterIORedirect().
|
private |
Definition at line 133 of file ScriptInterpreter.h.
Referenced by ScriptInterpreterIORedirect(), and ~ScriptInterpreterIORedirect().
|
private |
Definition at line 131 of file ScriptInterpreter.h.
Referenced by Flush(), GetErrorFile(), ScriptInterpreterIORedirect(), and ~ScriptInterpreterIORedirect().
|
private |
Definition at line 129 of file ScriptInterpreter.h.
Referenced by GetInputFile(), and ScriptInterpreterIORedirect().
|
private |
Definition at line 130 of file ScriptInterpreter.h.
Referenced by Flush(), GetOutputFile(), ScriptInterpreterIORedirect(), and ~ScriptInterpreterIORedirect().