[Lldb-commits] [lldb] r365978 - [DWARFContext] Strip leading dot in section names

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 12 17:12:22 PDT 2019


Author: jdevlieghere
Date: Fri Jul 12 17:12:22 2019
New Revision: 365978

URL: http://llvm.org/viewvc/llvm-project?rev=365978&view=rev
Log:
[DWARFContext] Strip leading dot in section names

The LLVM context doesn't expect the leading dot in the section name.

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp?rev=365978&r1=365977&r2=365978&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp Fri Jul 12 17:12:22 2019
@@ -116,6 +116,8 @@ llvm::DWARFContext &DWARFContext::GetAsL
 
       llvm::StringRef data = llvm::toStringRef(section_data.GetData());
       llvm::StringRef name = section.GetName().GetStringRef();
+      if (name.startswith("."))
+        name = name.drop_front();
       section_map.try_emplace(
           name, llvm::MemoryBuffer::getMemBuffer(data, name, false));
     };




More information about the lldb-commits mailing list