Go to the documentation of this file.
31 : m_broadcaster_wp(broadcaster->GetBroadcasterImpl()), m_type(event_type),
35 const EventDataSP &event_data_sp)
36 : m_broadcaster_wp(broadcaster->GetBroadcasterImpl()), m_type(event_type),
37 m_data_sp(event_data_sp) {}
40 : m_broadcaster_wp(), m_type(event_type), m_data_sp(data) {}
43 : m_broadcaster_wp(), m_type(event_type), m_data_sp(event_data_sp) {}
50 if (broadcaster_impl_sp)
51 broadcaster = broadcaster_impl_sp->GetBroadcaster();
53 broadcaster =
nullptr;
58 s->
Printf(
"%p Event: broadcaster = %p (%s), type = 0x%8.8x (%s), data = ",
59 static_cast<const void *
>(
this),
60 static_cast<void *
>(broadcaster),
64 s->
Printf(
"%p Event: broadcaster = %p (%s), type = 0x%8.8x, data = ",
65 static_cast<const void *
>(
this),
66 static_cast<void *
>(broadcaster),
69 s->
Printf(
"%p Event: broadcaster = NULL, type = 0x%8.8x, data = ",
70 static_cast<const void *
>(
this),
m_type);
86 #pragma mark EventData
97 #pragma mark EventDataBytes
127 size_t num_printable_chars =
129 if (num_printable_chars ==
m_bytes.size())
132 s->
Format(
"{0:$[ ]@[x-2]}", llvm::make_range(
133 reinterpret_cast<const uint8_t *
>(
m_bytes.data()),
134 reinterpret_cast<const uint8_t *
>(
m_bytes.data() +
145 if (src !=
nullptr && src_len > 0)
146 m_bytes.assign(
static_cast<const char *
>(src), src_len);
152 if (cstr !=
nullptr && cstr[0])
174 if (event_ptr !=
nullptr) {
188 #pragma mark EventStructuredData
193 :
EventData(), m_process_sp(), m_object_sp(), m_plugin_sp() {}
197 const lldb::StructuredDataPluginSP &plugin_sp)
198 :
EventData(), m_process_sp(process_sp), m_object_sp(object_sp),
199 m_plugin_sp(plugin_sp) {}
225 const lldb::StructuredDataPluginSP &
240 const lldb::StructuredDataPluginSP &plugin_sp) {
248 if (event_ptr ==
nullptr)
262 return event_data->GetProcess();
271 return event_data->GetObject();
276 lldb::StructuredDataPluginSP
280 return event_data->GetStructuredDataPlugin();
282 return StructuredDataPluginSP();
286 static ConstString s_flavor(
"EventDataStructuredData");
void Format(const char *format, Args &&... args)
virtual ConstString GetFlavor() const =0
size_t GetByteSize() const
const void * GetBytes() const
void Dump(Stream *s) const override
void SetProcess(const lldb::ProcessSP &process_sp)
ConstString GetFlavor() const override
EventDataStructuredData()
static size_t GetByteSizeFromEvent(const Event *event_ptr)
static const EventDataBytes * GetEventDataFromEvent(const Event *event_ptr)
void SwapBytes(std::string &new_bytes)
static ConstString GetFlavorString()
const lldb::StructuredDataPluginSP & GetStructuredDataPlugin() const
lldb::StructuredDataPluginSP m_plugin_sp
void Dump(Stream *s) const
void SetBytesFromCString(const char *cstr)
static StructuredData::ObjectSP GetObjectFromEvent(const Event *event_ptr)
lldb::ProcessSP m_process_sp
Broadcaster::BroadcasterImplWP m_broadcaster_wp
virtual void Dump(Stream *s) const
std::shared_ptr< Object > ObjectSP
const char * GetData() const
void Dump(Stream *s) const override
void SetBytes(const void *src, size_t src_len)
StructuredData::ObjectSP m_object_sp
string(SUBSTRING ${p} 10 -1 pStripped) if($
void SetStructuredDataPlugin(const lldb::StructuredDataPluginSP &plugin_sp)
static lldb::StructuredDataPluginSP GetPluginFromEvent(const Event *event_ptr)
std::shared_ptr< BroadcasterImpl > BroadcasterImplSP
~EventDataStructuredData() override
ConstString GetFlavor() const override
static const void * GetBytesFromEvent(const Event *event_ptr)
const char * GetCString() const
Get the string value as a C string.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
ConstString GetBroadcasterName()
Get the NULL terminated C string name of this Broadcaster object.
const StructuredData::ObjectSP & GetObject() const
A class that represents a running process on the host machine.
static ConstString GetFlavorString()
~EventDataBytes() override
const lldb::ProcessSP & GetProcess() const
lldb::EventDataSP m_data_sp
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
static lldb::ProcessSP GetProcessFromEvent(const Event *event_ptr)
static const EventDataStructuredData * GetEventDataFromEvent(const Event *event_ptr)
void SetObject(const StructuredData::ObjectSP &object_sp)
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.
This class handles one or more StructuredData::Dictionary entries that are raised for structured data...