[Lldb-commits] [PATCH] D143694: [lldb] Hoist code to create StructuredData into DiagnosticEventData (NFC)

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 9 18:41:03 PST 2023


mib accepted this revision.
mib added a comment.
This revision is now accepted and ready to land.

LGTM with some nitpicks.



================
Comment at: lldb/source/API/SBDebugger.cpp:175
 
-  const DiagnosticEventData *diagnostic_data =
-      DiagnosticEventData::GetEventDataFromEvent(event.get());
-  if (!diagnostic_data)
-    return {};
+  StructuredData::DictionarySP dictionary =
+      DiagnosticEventData::GetAsStructuredData(event.get());
----------------
nit: should be `dictionary_sp`


================
Comment at: lldb/source/Core/DebuggerEvents.cpp:96
+
+  auto dictionary = std::make_shared<StructuredData::Dictionary>();
+  dictionary->AddStringItem("message", diagnostic_data->GetMessage());
----------------
ditto


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143694/new/

https://reviews.llvm.org/D143694



More information about the lldb-commits mailing list