diff --git a/lldb/source/API/SBLaunchInfo.cpp b/lldb/source/API/SBLaunchInfo.cpp --- a/lldb/source/API/SBLaunchInfo.cpp +++ b/lldb/source/API/SBLaunchInfo.cpp @@ -377,19 +377,25 @@ return LLDB_RECORD_RESULT(data); } -void SBLaunchInfo::SetScriptedProcessDictionary(lldb::SBStructuredData dict) { +void SBLaunchInfo::SetScriptedProcessDictionary( + lldb::SBStructuredData sb_dict) { LLDB_RECORD_METHOD(void, SBLaunchInfo, SetScriptedProcessDictionary, - (lldb::SBStructuredData), dict); + (lldb::SBStructuredData), sb_dict); SBStream stream; - SBError error = dict.GetAsJSON(stream); + SBError error = sb_dict.GetAsJSON(stream); 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); }