[Lldb-commits] [lldb] r344173 - [SymbolFileNativePDB] Fix compilation errors with gcc.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 10 11:52:37 PDT 2018


Author: zturner
Date: Wed Oct 10 11:52:37 2018
New Revision: 344173

URL: http://llvm.org/viewvc/llvm-project?rev=344173&view=rev
Log:
[SymbolFileNativePDB] Fix compilation errors with gcc.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.h
    lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp?rev=344173&r1=344172&r2=344173&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbIndex.cpp Wed Oct 10 11:52:37 2018
@@ -134,14 +134,15 @@ void PdbIndex::BuildAddrToSymbolMap(Comp
     // If the debug info is incorrect, we could have multiple symbols with the
     // same address.  So use try_emplace instead of insert, and the first one
     // will win.
-    auto emplace_result = cci.m_symbols_by_va.try_emplace(va, cu_sym_uid);
-    (void)emplace_result;
+    auto insert_result =
+        cci.m_symbols_by_va.insert(std::make_pair(va, cu_sym_uid));
+    (void)insert_result;
 
     // The odds of an error in some function such as GetSegmentAndOffset or
     // MakeVirtualAddress are much higher than the odds of encountering bad
     // debug info, so assert that this item was inserted in the map as opposed
     // to having already been there.
-    lldbassert(emplace_result.second);
+    lldbassert(insert_result.second);
   }
 }
 

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp?rev=344173&r1=344172&r2=344173&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp Wed Oct 10 11:52:37 2018
@@ -219,14 +219,14 @@ GetSegmentOffsetAndLength<TrampolineSym>
 template <>
 SegmentOffsetLength GetSegmentOffsetAndLength<Thunk32Sym>(const CVSymbol &sym) {
   Thunk32Sym record = createRecord<Thunk32Sym>(sym);
-  return {record.Segment, record.Offset, record.Length};
+  return SegmentOffsetLength{record.Segment, record.Offset, record.Length};
 }
 
 template <>
 SegmentOffsetLength
 GetSegmentOffsetAndLength<CoffGroupSym>(const CVSymbol &sym) {
   CoffGroupSym record = createRecord<CoffGroupSym>(sym);
-  return {record.Segment, record.Offset, record.Size};
+  return SegmentOffsetLength{record.Segment, record.Offset, record.Size};
 }
 
 SegmentOffsetLength lldb_private::npdb::GetSegmentOffsetAndLength(

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.h?rev=344173&r1=344172&r2=344173&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/PdbUtil.h Wed Oct 10 11:52:37 2018
@@ -20,11 +20,16 @@ namespace lldb_private {
 namespace npdb {
 
 struct SegmentOffset {
+  SegmentOffset() = default;
+  SegmentOffset(uint16_t s, uint32_t o) : segment(s), offset(o) {}
   uint16_t segment = 0;
   uint32_t offset = 0;
 };
 
 struct SegmentOffsetLength {
+  SegmentOffsetLength() = default;
+  SegmentOffsetLength(uint16_t s, uint32_t o, uint32_t l)
+      : so(s, o), length(l) {}
   SegmentOffset so;
   uint32_t length = 0;
 };

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=344173&r1=344172&r2=344173&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp Wed Oct 10 11:52:37 2018
@@ -487,7 +487,6 @@ bool SymbolFileNativePDB::ParseCompileUn
       }
 
       // LLDB wants the index of the file in the list of support files.
-      llvm::StringRef file_name = *efn;
       auto fn_iter = llvm::find(cci->m_file_list, *efn);
       lldbassert(fn_iter != cci->m_file_list.end());
       uint32_t file_index = std::distance(cci->m_file_list.begin(), fn_iter);




More information about the lldb-commits mailing list