예제 #1
0
파일: Event.cpp 프로젝트: krytarowski/lldb
void Event::Dump(Stream *s) const {
    Broadcaster *broadcaster;
    Broadcaster::BroadcasterImplSP broadcaster_impl_sp(m_broadcaster_wp.lock());
    if (broadcaster_impl_sp)
        broadcaster = broadcaster_impl_sp->GetBroadcaster();
    else
        broadcaster = nullptr;

    if (broadcaster) {
        StreamString event_name;
        if (broadcaster->GetEventNames(event_name, m_type, false))
            s->Printf("%p Event: broadcaster = %p (%s), type = 0x%8.8x (%s), data = ",
                      static_cast<const void *>(this),
                      static_cast<void *>(broadcaster),
                      broadcaster->GetBroadcasterName().GetCString(), m_type,
                      event_name.GetString().c_str());
        else
            s->Printf("%p Event: broadcaster = %p (%s), type = 0x%8.8x, data = ",
                      static_cast<const void *>(this),
                      static_cast<void *>(broadcaster),
                      broadcaster->GetBroadcasterName().GetCString(), m_type);
    } else
        s->Printf("%p Event: broadcaster = NULL, type = 0x%8.8x, data = ",
                  static_cast<const void *>(this), m_type);

    if (m_data_sp) {
        s->PutChar('{');
        m_data_sp->Dump(s);
        s->PutChar('}');
    } else
        s->Printf("<NULL>");
}