LLDB mainline
|
#include <Listener.h>
Classes | |
struct | BroadcasterInfo |
Public Types | |
typedef bool(* | HandleBroadcastCallback) (lldb::EventSP &event_sp, void *baton) |
Public Member Functions | |
~Listener () | |
void | AddEvent (lldb::EventSP &event) |
void | Clear () |
const char * | GetName () |
uint32_t | StartListeningForEventSpec (const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec) |
bool | StopListeningForEventSpec (const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec) |
uint32_t | StartListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask) |
uint32_t | StartListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask, HandleBroadcastCallback callback, void *callback_user_data) |
bool | StopListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask) |
Event * | PeekAtNextEvent () |
Event * | PeekAtNextEventForBroadcaster (Broadcaster *broadcaster) |
Event * | PeekAtNextEventForBroadcasterWithType (Broadcaster *broadcaster, uint32_t event_type_mask) |
bool | GetEvent (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout) |
bool | GetEventForBroadcaster (Broadcaster *broadcaster, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout) |
bool | GetEventForBroadcasterWithType (Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout) |
size_t | HandleBroadcastEvent (lldb::EventSP &event_sp) |
Static Public Member Functions | |
static lldb::ListenerSP | MakeListener (const char *name) |
Protected Member Functions | |
Listener (const char *name) | |
Private Types | |
typedef std::multimap< Broadcaster::BroadcasterImplWP, BroadcasterInfo, std::owner_less< Broadcaster::BroadcasterImplWP > > | broadcaster_collection |
typedef std::list< lldb::EventSP > | event_collection |
typedef std::vector< lldb::BroadcasterManagerWP > | broadcaster_manager_collection |
Private Member Functions | |
bool | FindNextEventInternal (std::unique_lock< std::mutex > &lock, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, bool remove) |
bool | GetEventInternal (const Timeout< std::micro > &timeout, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp) |
void | BroadcasterWillDestruct (Broadcaster *) |
void | BroadcasterManagerWillDestruct (lldb::BroadcasterManagerSP manager_sp) |
Listener (const Listener &)=delete | |
const Listener & | operator= (const Listener &)=delete |
Private Attributes | |
std::string | m_name |
broadcaster_collection | m_broadcasters |
std::mutex | m_broadcasters_mutex |
event_collection | m_events |
std::mutex | m_events_mutex |
std::condition_variable | m_events_condition |
broadcaster_manager_collection | m_broadcaster_managers |
Friends | |
class | Broadcaster |
class | BroadcasterManager |
Definition at line 35 of file Listener.h.
|
private |
Definition at line 111 of file Listener.h.
|
private |
Definition at line 114 of file Listener.h.
|
private |
Definition at line 112 of file Listener.h.
typedef bool(* lldb_private::Listener::HandleBroadcastCallback) (lldb::EventSP &event_sp, void *baton) |
Definition at line 37 of file Listener.h.
|
protected |
Definition at line 21 of file Listener.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_name, and lldb_private::Object.
Listener::~Listener | ( | ) |
Definition at line 26 of file Listener.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_name, and lldb_private::Object.
|
privatedelete |
void Listener::AddEvent | ( | lldb::EventSP & | event | ) |
Definition at line 167 of file Listener.cpp.
References lldb_private::Events, lldb_private::GetLog(), LLDB_LOGF, m_events, m_events_condition, m_events_mutex, and m_name.
|
private |
Definition at line 158 of file Listener.cpp.
References m_broadcaster_managers.
|
private |
Definition at line 137 of file Listener.cpp.
References lldb_private::Broadcaster::GetBroadcasterImpl(), m_broadcasters, m_broadcasters_mutex, m_events, and m_events_mutex.
void Listener::Clear | ( | ) |
Definition at line 33 of file Listener.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_broadcaster_managers, m_broadcasters, m_broadcasters_mutex, m_events, m_events_mutex, m_name, and lldb_private::Object.
|
private |
Definition at line 179 of file Listener.cpp.
References lldb_private::Events, lldb_private::GetLog(), GetName(), LLDB_LOGF, and m_events.
Referenced by GetEventInternal(), PeekAtNextEvent(), PeekAtNextEventForBroadcaster(), and PeekAtNextEventForBroadcasterWithType().
bool Listener::GetEvent | ( | lldb::EventSP & | event_sp, |
const Timeout< std::micro > & | timeout | ||
) |
Definition at line 308 of file Listener.cpp.
References GetEventInternal().
bool Listener::GetEventForBroadcaster | ( | Broadcaster * | broadcaster, |
lldb::EventSP & | event_sp, | ||
const Timeout< std::micro > & | timeout | ||
) |
Definition at line 302 of file Listener.cpp.
References GetEventInternal().
bool Listener::GetEventForBroadcasterWithType | ( | Broadcaster * | broadcaster, |
uint32_t | event_type_mask, | ||
lldb::EventSP & | event_sp, | ||
const Timeout< std::micro > & | timeout | ||
) |
Definition at line 296 of file Listener.cpp.
References GetEventInternal().
|
private |
Definition at line 259 of file Listener.cpp.
References lldb_private::Events, FindNextEventInternal(), lldb_private::GetLog(), LLDB_LOG, LLDB_LOGF, m_events_condition, m_events_mutex, and m_name.
Referenced by GetEvent(), GetEventForBroadcaster(), and GetEventForBroadcasterWithType().
|
inline |
size_t Listener::HandleBroadcastEvent | ( | lldb::EventSP & | event_sp | ) |
Definition at line 312 of file Listener.cpp.
References lldb_private::Listener::BroadcasterInfo::callback, lldb_private::Listener::BroadcasterInfo::callback_user_data, lldb_private::Listener::BroadcasterInfo::event_mask, lldb_private::Broadcaster::GetBroadcasterImpl(), m_broadcasters, and m_broadcasters_mutex.
|
static |
Definition at line 376 of file Listener.cpp.
Referenced by ProcessKDP::AsyncThread(), PlatformPOSIX::Attach(), lldb_private::Target::Attach(), lldb_private::ProcessTrace::DidAttach(), lldb_private::Platform::DoConnectProcess(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), lldb_private::Process::Halt(), lldb_private::Target::Launch(), lldb_private::Process::LoadCore(), lldb_private::ThreadedCommunication::Read(), lldb_private::Process::ResumeSynchronous(), lldb_private::Process::RunThreadPlan(), lldb_private::Debugger::StartEventHandlerThread(), lldb_private::Process::StopForDestroyOrDetach(), and lldb_private::ThreadedCommunication::SynchronizeWithReadThread().
Event * Listener::PeekAtNextEvent | ( | ) |
Definition at line 232 of file Listener.cpp.
References FindNextEventInternal(), and m_events_mutex.
Event * Listener::PeekAtNextEventForBroadcaster | ( | Broadcaster * | broadcaster | ) |
Definition at line 240 of file Listener.cpp.
References FindNextEventInternal(), and m_events_mutex.
Event * Listener::PeekAtNextEventForBroadcasterWithType | ( | Broadcaster * | broadcaster, |
uint32_t | event_type_mask | ||
) |
Definition at line 249 of file Listener.cpp.
References FindNextEventInternal(), and m_events_mutex.
uint32_t Listener::StartListeningForEvents | ( | Broadcaster * | broadcaster, |
uint32_t | event_mask | ||
) |
Definition at line 58 of file Listener.cpp.
References lldb_private::Broadcaster::AddListener(), lldb_private::Events, lldb_private::Broadcaster::GetBroadcasterImpl(), lldb_private::GetLog(), LLDB_LOGF, m_broadcasters, m_broadcasters_mutex, and m_name.
uint32_t Listener::StartListeningForEvents | ( | Broadcaster * | broadcaster, |
uint32_t | event_mask, | ||
HandleBroadcastCallback | callback, | ||
void * | callback_user_data | ||
) |
Definition at line 86 of file Listener.cpp.
References lldb_private::Broadcaster::AddListener(), lldb_private::Events, lldb_private::Broadcaster::GetBroadcasterImpl(), lldb_private::GetLog(), LLDB_LOGF, m_broadcasters, m_broadcasters_mutex, and m_name.
uint32_t Listener::StartListeningForEventSpec | ( | const lldb::BroadcasterManagerSP & | manager_sp, |
const BroadcastEventSpec & | event_spec | ||
) |
Definition at line 336 of file Listener.cpp.
References m_broadcaster_managers, and m_broadcasters_mutex.
bool Listener::StopListeningForEvents | ( | Broadcaster * | broadcaster, |
uint32_t | event_mask | ||
) |
Definition at line 120 of file Listener.cpp.
References lldb_private::Broadcaster::GetBroadcasterImpl(), m_broadcasters, m_broadcasters_mutex, and lldb_private::Broadcaster::RemoveListener().
bool Listener::StopListeningForEventSpec | ( | const lldb::BroadcasterManagerSP & | manager_sp, |
const BroadcastEventSpec & | event_spec | ||
) |
Definition at line 363 of file Listener.cpp.
References m_broadcasters_mutex.
|
friend |
Definition at line 39 of file Listener.h.
|
friend |
Definition at line 40 of file Listener.h.
|
private |
Definition at line 132 of file Listener.h.
Referenced by BroadcasterManagerWillDestruct(), Clear(), and StartListeningForEventSpec().
|
private |
Definition at line 127 of file Listener.h.
Referenced by BroadcasterWillDestruct(), Clear(), HandleBroadcastEvent(), StartListeningForEvents(), and StopListeningForEvents().
|
private |
Definition at line 128 of file Listener.h.
Referenced by BroadcasterWillDestruct(), Clear(), HandleBroadcastEvent(), StartListeningForEvents(), StartListeningForEventSpec(), StopListeningForEvents(), and StopListeningForEventSpec().
|
private |
Definition at line 129 of file Listener.h.
Referenced by AddEvent(), BroadcasterWillDestruct(), Clear(), and FindNextEventInternal().
|
private |
Definition at line 131 of file Listener.h.
Referenced by AddEvent(), and GetEventInternal().
|
private |
Definition at line 130 of file Listener.h.
Referenced by AddEvent(), BroadcasterWillDestruct(), Clear(), GetEventInternal(), PeekAtNextEvent(), PeekAtNextEventForBroadcaster(), and PeekAtNextEventForBroadcasterWithType().
|
private |
Definition at line 126 of file Listener.h.
Referenced by AddEvent(), Clear(), GetEventInternal(), GetName(), Listener(), StartListeningForEvents(), and ~Listener().