[Lldb-commits] [PATCH] D143687: [lldb] Add an SB API to get progress events as SBStructuredData

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 9 15:46:28 PST 2023


JDevlieghere added inline comments.


================
Comment at: lldb/source/API/SBDebugger.cpp:175-186
+  const ProgressEventData *progress_data =
+      ProgressEventData::GetEventDataFromEvent(event.get());
+  if (!progress_data)
+    return {};
+
+  auto dictionary = std::make_unique<StructuredData::Dictionary>();
+  dictionary->AddStringItem("message", progress_data->GetMessage());
----------------
mib wrote:
> It feels wrong me that we're doing this at the SB API levels, I feel like we should have an overload of `ProgressEventData::GetEventDataFromEvent` that returns an actual structured data dictionary. This way, when we extend the progress events, we won't need to update all the places where `GetEventDataFromEvent` is called from.
Good point, I totally agree. I'll move the code into the ProgressEventData and DiagnosticEventData respectively and have that return a StructuredData dictionary. 


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

https://reviews.llvm.org/D143687



More information about the lldb-commits mailing list