13#include "llvm/Support/WithColor.h"
22 if (event_data->GetFlavor() == T::GetFlavorString())
23 return static_cast<const T *
>(event_ptr->
GetData());
28 return "ProgressEventData";
51 return GetEventDataFromEventImpl<ProgressEventData>(event_ptr);
62 auto dictionary_sp = std::make_shared<StructuredData::Dictionary>();
63 dictionary_sp->AddStringItem(
"title", progress_data->
GetTitle());
64 dictionary_sp->AddStringItem(
"details", progress_data->
GetDetails());
65 dictionary_sp->AddStringItem(
"message", progress_data->
GetMessage());
66 dictionary_sp->AddIntegerItem(
"progress_id", progress_data->
GetID());
67 dictionary_sp->AddIntegerItem(
"completed", progress_data->
GetCompleted());
68 dictionary_sp->AddIntegerItem(
"total", progress_data->
GetTotal());
69 dictionary_sp->AddBooleanItem(
"debugger_specific",
77 case Severity::eSeverityInfo:
79 case Severity::eSeverityWarning:
81 case Severity::eSeverityError:
84 llvm_unreachable(
"Fully covered switch above!");
89 ? llvm::HighlightColor::Warning
90 : llvm::HighlightColor::Error;
91 llvm::WithColor(s->
AsRawOstream(), color, llvm::ColorMode::Enable)
98 return "DiagnosticEventData";
107 return GetEventDataFromEventImpl<DiagnosticEventData>(event_ptr);
115 if (!diagnostic_data)
118 auto dictionary_sp = std::make_shared<StructuredData::Dictionary>();
119 dictionary_sp->AddStringItem(
"message", diagnostic_data->
GetMessage());
120 dictionary_sp->AddStringItem(
"type", diagnostic_data->
GetPrefix());
121 dictionary_sp->AddBooleanItem(
"debugger_specific",
123 return dictionary_sp;
127 return "SymbolChangeEventData";
136 return GetEventDataFromEventImpl<SymbolChangeEventData>(event_ptr);
144 for (
TargetSP target_sp : debugger_sp->GetTargetList().Targets()) {
148 std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
149 if (!module_sp->GetSymbolFileFileSpec())
153 module_list.
Append(module_sp);
154 target_sp->SymbolsDidLoad(module_list);
static const T * GetEventDataFromEventImpl(const Event *event_ptr)
void Dump(Stream *s) const override
lldb::Severity m_severity
static llvm::StringRef GetFlavorString()
const std::string & GetMessage() const
llvm::StringRef GetPrefix() const
bool IsDebuggerSpecific() const
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
static const DiagnosticEventData * GetEventDataFromEvent(const Event *event_ptr)
llvm::StringRef GetFlavor() const override
A collection class for Module objects.
void Append(const lldb::ModuleSP &module_sp, bool notify=true)
Append a module to the module list.
FileSpec & GetSymbolFileSpec()
void Dump(Stream *s) const override
llvm::StringRef GetFlavor() const override
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
bool IsDebuggerSpecific() const
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
uint64_t GetCompleted() const
std::string m_details
Details associated with this progress event update.
uint64_t GetTotal() const
static llvm::StringRef GetFlavorString()
const uint64_t m_id
Unique ID used to associate progress events.
const std::string & GetTitle() const
std::string m_title
The title of this progress event.
std::string GetMessage() const
const std::string & GetDetails() const
static constexpr uint64_t kNonDeterministicTotal
Used to indicate a non-deterministic progress report.
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
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.
virtual void Flush()=0
Flush the stream.
std::shared_ptr< Dictionary > DictionarySP
static const SymbolChangeEventData * GetEventDataFromEvent(const Event *event_ptr)
lldb::DebuggerWP m_debugger_wp
llvm::StringRef GetFlavor() const override
static llvm::StringRef GetFlavorString()
void DoOnRemoval(Event *event_ptr) override
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::Module > ModuleSP