|
LLDB mainline
|
#include <MainLoopPosix.h>
Classes | |
| class | RunImpl |
| class | SignalHandle |
| struct | SignalInfo |
Public Types | |
| typedef std::unique_ptr< SignalHandle > | SignalHandleUP |
| Public Types inherited from lldb_private::MainLoopBase | |
| using | TimePoint |
| typedef std::unique_ptr< ReadHandle > | ReadHandleUP |
| typedef std::function< void(MainLoopBase &)> | Callback |
Public Member Functions | |
| MainLoopPosix () | |
| ~MainLoopPosix () override | |
| ReadHandleUP | RegisterReadObject (const lldb::IOObjectSP &object_sp, const Callback &callback, Status &error) override |
| SignalHandleUP | RegisterSignal (int signo, const Callback &callback, Status &error) |
| Status | Run () override |
| Public Member Functions inherited from lldb_private::MainLoopBase | |
| MainLoopBase () | |
| virtual | ~MainLoopBase ()=default |
| bool | AddPendingCallback (const Callback &callback) |
| bool | AddCallback (const Callback &callback, std::chrono::nanoseconds delay) |
| bool | AddCallback (const Callback &callback, TimePoint point) |
| virtual void | RequestTermination () |
Protected Member Functions | |
| void | UnregisterReadObject (IOObject::WaitableHandle handle) override |
| void | UnregisterSignal (int signo, std::list< Callback >::iterator callback_it) |
| bool | Interrupt () override |
| Interrupt the loop that is currently waiting for events. | |
| Protected Member Functions inherited from lldb_private::MainLoopBase | |
| ReadHandleUP | CreateReadHandle (const lldb::IOObjectSP &object_sp) |
| void | ProcessCallbacks () |
| std::optional< TimePoint > | GetNextWakeupTime () |
Private Member Functions | |
| void | ProcessReadObject (IOObject::WaitableHandle handle) |
| void | ProcessSignal (int signo) |
| void | ProcessSignals () |
Private Attributes | |
| llvm::DenseMap< IOObject::WaitableHandle, Callback > | m_read_fds |
| llvm::DenseMap< int, SignalInfo > | m_signals |
| Pipe | m_interrupt_pipe |
| std::atomic< bool > | m_interrupting = false |
Additional Inherited Members | |
| Protected Attributes inherited from lldb_private::MainLoopBase | |
| std::mutex | m_callback_mutex |
| std::priority_queue< std::pair< TimePoint, Callback >, std::vector< std::pair< TimePoint, Callback > >, llvm::on_first< std::greater< TimePoint > > > | m_callbacks |
| bool | m_terminate_request: 1 |
Definition at line 27 of file MainLoopPosix.h.
| typedef std::unique_ptr<SignalHandle> lldb_private::MainLoopPosix::SignalHandleUP |
Definition at line 32 of file MainLoopPosix.h.
| MainLoopPosix::MainLoopPosix | ( | ) |
Definition at line 210 of file MainLoopPosix.cpp.
References error(), m_interrupt_pipe, m_read_fds, lldb_private::MainLoopBase::MainLoopBase(), O_NONBLOCK, and UNUSED_IF_ASSERT_DISABLED.
Referenced by lldb_private::MainLoopPosix::RunImpl::RunImpl().
|
override |
Definition at line 238 of file MainLoopPosix.cpp.
References m_interrupt_pipe, m_read_fds, and m_signals.
|
overrideprotectedvirtual |
Interrupt the loop that is currently waiting for events.
Return true if the interrupt succeeded, false if it failed.
Implements lldb_private::MainLoopBase.
Definition at line 390 of file MainLoopPosix.cpp.
References m_interrupt_pipe, and m_interrupting.
|
private |
Definition at line 357 of file MainLoopPosix.cpp.
References m_read_fds.
|
private |
Definition at line 378 of file MainLoopPosix.cpp.
References m_signals.
Referenced by ProcessSignals().
|
private |
Definition at line 363 of file MainLoopPosix.cpp.
References g_signal_info, m_signals, lldb_private::MainLoopBase::m_terminate_request, and ProcessSignal().
Referenced by Run().
|
overridevirtual |
Implements lldb_private::MainLoopBase.
Definition at line 249 of file MainLoopPosix.cpp.
References lldb_private::MainLoopBase::CreateReadHandle(), error(), lldb_private::Status::FromErrorString(), lldb_private::Status::FromErrorStringWithFormat(), and m_read_fds.
Referenced by lldb_private::transport::IOTransport< Proto >::RegisterMessageHandler().
| MainLoopPosix::SignalHandleUP MainLoopPosix::RegisterSignal | ( | int | signo, |
| const Callback & | callback, | ||
| Status & | error ) |
Definition at line 271 of file MainLoopPosix.cpp.
References lldb_private::MainLoopPosix::SignalInfo::callbacks, error(), g_signal_info, m_interrupt_pipe, m_signals, lldb_private::MainLoopPosix::SignalInfo::old_action, SignalHandler(), UNUSED_IF_ASSERT_DISABLED, and lldb_private::MainLoopPosix::SignalInfo::was_blocked.
Referenced by lldb_private::process_aix::NativeProcessAIX::Manager::Manager(), lldb_private::process_linux::NativeProcessLinux::Manager::Manager(), lldb_private::process_freebsd::NativeProcessFreeBSD::NativeProcessFreeBSD(), and lldb_private::process_netbsd::NativeProcessNetBSD::NativeProcessNetBSD().
|
overridevirtual |
Reimplemented from lldb_private::MainLoopBase.
Definition at line 336 of file MainLoopPosix.cpp.
References error(), m_interrupting, lldb_private::MainLoopBase::m_terminate_request, lldb_private::MainLoopPosix::RunImpl::Poll(), lldb_private::MainLoopBase::ProcessCallbacks(), lldb_private::MainLoopPosix::RunImpl::ProcessReadEvents(), ProcessSignals(), and lldb_private::Status.
Referenced by lldb_private::Socket::Accept().
|
overrideprotectedvirtual |
Implements lldb_private::MainLoopBase.
Definition at line 306 of file MainLoopPosix.cpp.
References m_read_fds, and UNUSED_IF_ASSERT_DISABLED.
|
protected |
Definition at line 312 of file MainLoopPosix.cpp.
References g_signal_info, m_signals, and UNUSED_IF_ASSERT_DISABLED.
|
private |
Definition at line 91 of file MainLoopPosix.h.
Referenced by Interrupt(), MainLoopPosix(), RegisterSignal(), and ~MainLoopPosix().
|
private |
Definition at line 92 of file MainLoopPosix.h.
Referenced by Interrupt(), and Run().
|
private |
Definition at line 89 of file MainLoopPosix.h.
Referenced by MainLoopPosix(), ProcessReadObject(), RegisterReadObject(), UnregisterReadObject(), and ~MainLoopPosix().
|
private |
Definition at line 90 of file MainLoopPosix.h.
Referenced by ProcessSignal(), ProcessSignals(), RegisterSignal(), UnregisterSignal(), and ~MainLoopPosix().