[Lldb-commits] [PATCH] D112045: [lldb/API] Fix SBLaunchInfo::SetScriptedProcessDictionary

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 18 18:15:28 PDT 2021


mib updated this revision to Diff 380560.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112045

Files:
  lldb/source/API/SBLaunchInfo.cpp


Index: lldb/source/API/SBLaunchInfo.cpp
===================================================================
--- lldb/source/API/SBLaunchInfo.cpp
+++ lldb/source/API/SBLaunchInfo.cpp
@@ -387,9 +387,14 @@
   if (error.Fail())
     return;
 
-  StructuredData::DictionarySP dict_sp;
-  llvm::json::OStream s(stream.ref().AsRawOstream());
-  dict_sp->Serialize(s);
+  StructuredData::ObjectSP obj_sp =
+      StructuredData::ParseJSON(std::string(stream.GetData()));
+  if (!obj_sp)
+    return;
+
+  StructuredData::DictionarySP dict_sp(obj_sp->GetAsDictionary());
+  if (!dict_sp)
+    return;
 
   m_opaque_sp->SetScriptedProcessDictionarySP(dict_sp);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112045.380560.patch
Type: text/x-patch
Size: 654 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211019/92190bff/attachment.bin>


More information about the lldb-commits mailing list