diff options
Diffstat (limited to 'lldb/source/API/SBDebugger.cpp')
-rw-r--r-- | lldb/source/API/SBDebugger.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp index 851c80a..be86078 100644 --- a/lldb/source/API/SBDebugger.cpp +++ b/lldb/source/API/SBDebugger.cpp @@ -172,19 +172,14 @@ lldb::SBStructuredData SBDebugger::GetDiagnosticFromEvent(const lldb::SBEvent &event) { LLDB_INSTRUMENT_VA(event); - const DiagnosticEventData *diagnostic_data = - DiagnosticEventData::GetEventDataFromEvent(event.get()); - if (!diagnostic_data) - return {}; + StructuredData::DictionarySP dictionary_sp = + DiagnosticEventData::GetAsStructuredData(event.get()); - auto dictionary = std::make_unique<StructuredData::Dictionary>(); - dictionary->AddStringItem("message", diagnostic_data->GetMessage()); - dictionary->AddStringItem("type", diagnostic_data->GetPrefix()); - dictionary->AddBooleanItem("debugger_specific", - diagnostic_data->IsDebuggerSpecific()); + if (!dictionary_sp) + return {}; SBStructuredData data; - data.m_impl_up->SetObjectSP(std::move(dictionary)); + data.m_impl_up->SetObjectSP(std::move(dictionary_sp)); return data; } |