From c156427ded1dfa7686c90cc56ad16013a079a742 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 16 Nov 2016 21:15:24 +0000 Subject: Don't allow direct access to StreamString's internal buffer. This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152 --- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | 4 ++-- lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lldb/source/Plugins/SymbolFile') diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 44ff9cc9a5d..c5a62d52356 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -2601,7 +2601,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc, if (type_quals & clang::Qualifiers::Const) sstr << " const"; - func_name.SetValue(ConstString(sstr.GetData()), false); + func_name.SetValue(ConstString(sstr.GetString()), false); } else func_name.SetValue(ConstString(name), false); @@ -2815,7 +2815,7 @@ bool DWARFASTParserClang::ParseChildMembers( ss.Printf("set%c%s:", toupper(prop_name[0]), &prop_name[1]); - fixed_setter.SetCString(ss.GetData()); + fixed_setter.SetString(ss.GetString()); prop_setter_name = fixed_setter.GetCString(); } } diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp index 66dee4b7ff8..6d3ff8e3591 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp @@ -265,7 +265,7 @@ size_t DWARFCompileUnit::ExtractDIEsIfNeeded(bool cu_die_only) { strm.Printf("error: no DIE for compile unit"); else m_die_array[0].Dump(m_dwarf2Data, this, strm, UINT32_MAX); - verbose_log->PutCString(strm.GetString().c_str()); + verbose_log->PutString(strm.GetString()); } if (!m_dwo_symbol_file) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index d82b3d42db8..392774544d1 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -3918,7 +3918,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc, NULL); GetObjectFile()->GetModule()->ReportError( "0x%8.8x: %s has an invalid location: %s", die.GetOffset(), - die.GetTagAsCString(), strm.GetString().c_str()); + die.GetTagAsCString(), strm.GetData()); } } SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile(); -- cgit v1.2.3