19#include "llvm/ADT/StringExtras.h"
34 : m_broadcaster_wp(broadcaster->GetBroadcasterImpl()), m_type(event_type),
39 : m_broadcaster_wp(broadcaster->GetBroadcasterImpl()), m_type(event_type),
40 m_data_sp(event_data_sp) {}
43 : m_broadcaster_wp(), m_type(event_type), m_data_sp(data) {}
46 : m_broadcaster_wp(), m_type(event_type), m_data_sp(event_data_sp) {}
53 if (broadcaster_impl_sp)
54 broadcaster = broadcaster_impl_sp->GetBroadcaster();
56 broadcaster =
nullptr;
61 s->
Printf(
"%p Event: broadcaster = %p (%s), type = 0x%8.8x (%s), data = ",
62 static_cast<const void *
>(
this),
63 static_cast<void *
>(broadcaster),
67 s->
Printf(
"%p Event: broadcaster = %p (%s), type = 0x%8.8x, data = ",
68 static_cast<const void *
>(
this),
69 static_cast<void *
>(broadcaster),
72 s->
Printf(
"%p Event: broadcaster = NULL, type = 0x%8.8x, data = ",
73 static_cast<const void *
>(
this),
m_type);
94 EventSP me_sp = shared_from_this();
95 if (
m_data_sp->ForwardEventToPendingListeners(
this)) {
97 listener_sp->AddEvent(me_sp);
103#pragma mark EventData
114#pragma mark EventDataBytes
131 if (llvm::all_of(
m_bytes, llvm::isPrint))
134 s->
Format(
"{0:$[ ]@[x-2]}", llvm::make_range(
135 reinterpret_cast<const uint8_t *
>(
m_bytes.data()),
136 reinterpret_cast<const uint8_t *
>(
m_bytes.data() +
162 if (event_ptr !=
nullptr) {
172 return "Process::ProcessEventData";
176#pragma mark EventStructuredData
181 :
EventData(), m_process_sp(), m_object_sp(), m_plugin_sp() {}
186 :
EventData(), m_process_sp(process_sp), m_object_sp(object_sp),
187 m_plugin_sp(plugin_sp) {}
236 if (event_ptr ==
nullptr)
250 return event_data->GetProcess();
259 return event_data->GetObject();
268 return event_data->GetStructuredDataPlugin();
274 return "EventDataStructuredData";
An event broadcasting class.
const std::string & GetBroadcasterName()
Get this broadcaster's name.
std::shared_ptr< BroadcasterImpl > BroadcasterImplSP
bool GetEventNames(Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const
Get the event name(s) for one or more event bits.
const void * GetBytes() const
~EventDataBytes() override
static llvm::StringRef GetFlavorString()
static const void * GetBytesFromEvent(const Event *event_ptr)
static size_t GetByteSizeFromEvent(const Event *event_ptr)
llvm::StringRef GetFlavor() const override
void Dump(Stream *s) const override
static const EventDataBytes * GetEventDataFromEvent(const Event *event_ptr)
size_t GetByteSize() const
static llvm::StringRef GetFlavorString()
This class handles one or more StructuredData::Dictionary entries that are raised for structured data...
llvm::StringRef GetFlavor() const override
const StructuredData::ObjectSP & GetObject() const
const lldb::ProcessSP & GetProcess() const
void SetStructuredDataPlugin(const lldb::StructuredDataPluginSP &plugin_sp)
lldb::StructuredDataPluginSP m_plugin_sp
const lldb::StructuredDataPluginSP & GetStructuredDataPlugin() const
void SetObject(const StructuredData::ObjectSP &object_sp)
StructuredData::ObjectSP m_object_sp
static llvm::StringRef GetFlavorString()
static lldb::ProcessSP GetProcessFromEvent(const Event *event_ptr)
~EventDataStructuredData() override
lldb::ProcessSP m_process_sp
void SetProcess(const lldb::ProcessSP &process_sp)
static lldb::StructuredDataPluginSP GetPluginFromEvent(const Event *event_ptr)
EventDataStructuredData()
static StructuredData::ObjectSP GetObjectFromEvent(const Event *event_ptr)
static const EventDataStructuredData * GetEventDataFromEvent(const Event *event_ptr)
void Dump(Stream *s) const override
virtual void Dump(Stream *s) const
virtual llvm::StringRef GetFlavor() const =0
Broadcaster::BroadcasterImplWP m_broadcaster_wp
lldb::EventDataSP m_data_sp
std::mutex m_listeners_mutex
void Dump(Stream *s) const
std::vector< lldb::ListenerSP > m_pending_listeners
const char * GetData() const
A stream class that can stream formatted output to a file.
void Format(const char *format, Args &&... args)
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::StructuredDataPlugin > StructuredDataPluginSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Event > EventSP
std::shared_ptr< lldb_private::EventData > EventDataSP