[Lldb-commits] [lldb] [lldb/API] Add setters to SBStructuredData (PR #154445)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 20 10:25:09 PDT 2025


================
@@ -81,6 +81,39 @@ class StructuredDataImpl {
 
   void SetObjectSP(const StructuredData::ObjectSP &obj) { m_data_sp = obj; }
 
+  void SetValueForKey(const char *key,
+                      const StructuredData::ObjectSP &value) const {
+    if (m_data_sp) {
+      auto dict = m_data_sp->GetAsDictionary();
+      if (dict)
+        return dict->AddItem(key, value);
----------------
bulbazord wrote:

To add to that, I'd recommend doing `auto *dict` to show that `dict` is a pointer.

https://github.com/llvm/llvm-project/pull/154445


More information about the lldb-commits mailing list