[Lldb-commits] [PATCH] D72917: [lldb/DWARF] Change how we construct a llvm::DWARFContext
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 20 02:53:40 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG06e73f071ae1: [lldb/DWARF] Change how we construct a llvm::DWARFContext (authored by labath).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72917/new/
https://reviews.llvm.org/D72917
Files:
lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp
Index: lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp
===================================================================
--- lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp
+++ lldb/test/Shell/SymbolFile/DWARF/debug-names-compressed.cpp
@@ -3,12 +3,15 @@
// REQUIRES: lld, zlib
-// RUN: %clang -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %s
+// RUN: %clang -c -o %t.o --target=x86_64-pc-linux -gdwarf-5 -gpubnames %s
// RUN: ld.lld %t.o -o %t --compress-debug-sections=zlib
+// RUN: llvm-readobj --sections %t | FileCheck %s --check-prefix NAMES
// RUN: lldb-test symbols --find=variable --name=foo %t | FileCheck %s
+// NAMES: Name: .debug_names
+
// CHECK: Found 1 variables:
int foo;
-// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = debug-names-compressed.cpp:[[@LINE-1]]
+// CHECK-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = debug-names-compressed.cpp:[[@LINE-1]]
extern "C" void _start() {}
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
===================================================================
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
@@ -117,32 +117,17 @@
if (!m_llvm_context) {
llvm::StringMap<std::unique_ptr<llvm::MemoryBuffer>> section_map;
uint8_t addr_size = 0;
-
- auto AddSection = [&](Section §ion) {
- DataExtractor section_data;
- section.GetSectionData(section_data);
-
+ auto AddSection = [&](llvm::StringRef name, DWARFDataExtractor data) {
// Set the address size the first time we see it.
if (addr_size == 0)
- addr_size = section_data.GetByteSize();
+ addr_size = data.GetAddressByteSize();
- 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));
+ name, llvm::MemoryBuffer::getMemBuffer(toStringRef(data.GetData()),
+ name, false));
};
- if (m_main_section_list) {
- for (auto §ion : *m_main_section_list)
- AddSection(*section);
- }
-
- if (m_dwo_section_list) {
- for (auto §ion : *m_dwo_section_list)
- AddSection(*section);
- }
+ AddSection("debug_line_str", getOrLoadLineStrData());
m_llvm_context = llvm::DWARFContext::create(section_map, addr_size);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72917.239046.patch
Type: text/x-patch
Size: 2605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200120/464165d6/attachment-0001.bin>
More information about the lldb-commits
mailing list