wallace created this revision. Herald added a project: All. wallace requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
`StartEventHandlerThread` and `StopEventHandlerThread` are available to the SwiftREPL even though they are protected because SwiftREPL is a friend class of Debugger. I'm developing my own REPL and having access to these functions, including `FlushProcessOutput`, is desirable. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D149717 Files: lldb/include/lldb/Core/Debugger.h Index: lldb/include/lldb/Core/Debugger.h =================================================================== --- lldb/include/lldb/Core/Debugger.h +++ lldb/include/lldb/Core/Debugger.h @@ -500,6 +500,19 @@ SetDestroyCallback(lldb_private::DebuggerDestroyCallback destroy_callback, void *baton); + /// Manually start the global event handler thread. It should be used by + /// programs that use LLDB as a library. + bool StartEventHandlerThread(); + + /// Stop the global event handler thread. It should only be used by programs + /// that manually invoked \a Debugger::StartEventHandlerThread(). + void StopEventHandlerThread(); + + /// Force flushing the process's pending stdout and stderr to the debuggers' + /// asynchronous stdout and stderr streams. + void FlushProcessOutput(Process &process, bool flush_stdout, + bool flush_stderr); + protected: friend class CommandInterpreter; friend class REPL; @@ -548,10 +561,6 @@ void PrintProgress(const ProgressEventData &data); - bool StartEventHandlerThread(); - - void StopEventHandlerThread(); - void PushIOHandler(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler = true); @@ -587,8 +596,6 @@ // Ensures two threads don't attempt to flush process output in parallel. std::mutex m_output_flush_mutex; - void FlushProcessOutput(Process &process, bool flush_stdout, - bool flush_stderr); SourceManager::SourceFileCache &GetSourceFileCache() { return m_source_file_cache;
Index: lldb/include/lldb/Core/Debugger.h =================================================================== --- lldb/include/lldb/Core/Debugger.h +++ lldb/include/lldb/Core/Debugger.h @@ -500,6 +500,19 @@ SetDestroyCallback(lldb_private::DebuggerDestroyCallback destroy_callback, void *baton); + /// Manually start the global event handler thread. It should be used by + /// programs that use LLDB as a library. + bool StartEventHandlerThread(); + + /// Stop the global event handler thread. It should only be used by programs + /// that manually invoked \a Debugger::StartEventHandlerThread(). + void StopEventHandlerThread(); + + /// Force flushing the process's pending stdout and stderr to the debuggers' + /// asynchronous stdout and stderr streams. + void FlushProcessOutput(Process &process, bool flush_stdout, + bool flush_stderr); + protected: friend class CommandInterpreter; friend class REPL; @@ -548,10 +561,6 @@ void PrintProgress(const ProgressEventData &data); - bool StartEventHandlerThread(); - - void StopEventHandlerThread(); - void PushIOHandler(const lldb::IOHandlerSP &reader_sp, bool cancel_top_handler = true); @@ -587,8 +596,6 @@ // Ensures two threads don't attempt to flush process output in parallel. std::mutex m_output_flush_mutex; - void FlushProcessOutput(Process &process, bool flush_stdout, - bool flush_stderr); SourceManager::SourceFileCache &GetSourceFileCache() { return m_source_file_cache;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits