LLDB mainline
lldb_private::ScriptInterpreterIORedirect Class Reference

#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::LockableStreamFileSP m_output_file_sp
lldb::LockableStreamFileSP m_error_file_sp
LockableStreamFile::Mutex m_output_mutex
ThreadedCommunication m_communication
bool m_disconnect

Detailed Description

Definition at line 111 of file ScriptInterpreter.h.

Constructor & Destructor Documentation

◆ ~ScriptInterpreterIORedirect()

ScriptInterpreterIORedirect::~ScriptInterpreterIORedirect ( )

◆ ScriptInterpreterIORedirect() [1/2]

ScriptInterpreterIORedirect::ScriptInterpreterIORedirect ( std::unique_ptr< File > input,
std::unique_ptr< File > output )
private

◆ ScriptInterpreterIORedirect() [2/2]

Member Function Documentation

◆ Create()

llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > ScriptInterpreterIORedirect::Create ( bool enable_io,
Debugger & debugger,
CommandReturnObject * result )
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 192 of file ScriptInterpreter.cpp.

References lldb_private::FileSystem::DEV_NULL, lldb_private::File::eOpenOptionReadOnly, lldb_private::File::eOpenOptionWriteOnly, lldb_private::FileSystem::Instance(), lldb_private::FileSystem::Open(), and ScriptInterpreterIORedirect().

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ Flush()

void ScriptInterpreterIORedirect::Flush ( )

Flush our output and error file handles.

Definition at line 267 of file ScriptInterpreter.cpp.

References m_error_file_sp, and m_output_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ GetErrorFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetErrorFile ( ) const
inline

Definition at line 125 of file ScriptInterpreter.h.

References m_error_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

◆ GetInputFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetInputFile ( ) const
inline

Definition at line 121 of file ScriptInterpreter.h.

References m_input_file_sp.

◆ GetOutputFile()

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::GetOutputFile ( ) const
inline

Definition at line 122 of file ScriptInterpreter.h.

References m_output_file_sp.

Referenced by lldb_private::ScriptInterpreterLua::ExecuteOneLine().

Member Data Documentation

◆ m_communication

ThreadedCommunication lldb_private::ScriptInterpreterIORedirect::m_communication
private

◆ m_disconnect

bool lldb_private::ScriptInterpreterIORedirect::m_disconnect
private

◆ m_error_file_sp

lldb::LockableStreamFileSP lldb_private::ScriptInterpreterIORedirect::m_error_file_sp
private

◆ m_input_file_sp

lldb::FileSP lldb_private::ScriptInterpreterIORedirect::m_input_file_sp
private

◆ m_output_file_sp

lldb::LockableStreamFileSP lldb_private::ScriptInterpreterIORedirect::m_output_file_sp
private

◆ m_output_mutex

LockableStreamFile::Mutex lldb_private::ScriptInterpreterIORedirect::m_output_mutex
private

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