`clang -g -gpubnames` (with optional -gsplit-dwarf) creates the
`.debug_names` section ("per-CU" index). By default lld concatenates
input `.debug_names` sections into an output `.debug_names` section.
LLDB can consume the concatenated section but the lookup performance is
not good.
This patch adds --debug-names to create a per-module index by combining
the per-CU indexes into a single index that covers the entire load
module. The produced `.debug_names` is a replacement for `.gdb_index`.
Type units (-fdebug-types-section) are not handled yet.
Co-authored-by: Fangrui Song <i@maskray.me>
---------
Co-authored-by: Fangrui Song <i@maskray.me>
15 lines
575 B
ArmAsm
15 lines
575 B
ArmAsm
# REQUIRES: x86
|
|
# RUN: rm -rf %t && mkdir %t && cd %t
|
|
# RUN: sed 's/LLVM0700/LLVM9999/' %S/Inputs/debug-names-a.s | llvm-mc -filetype=obj -triple=x86_64 -o a.o
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64 %S/Inputs/debug-names-b.s -o b.o
|
|
# RUN: ld.lld --debug-names a.o b.o -o out
|
|
# RUN: llvm-dwarfdump -debug-names out | FileCheck %s --check-prefix=DWARF
|
|
|
|
# DWARF: .debug_names contents:
|
|
# DWARF: Name Index @ 0x0 {
|
|
# DWARF-NEXT: Header {
|
|
# DWARF-NEXT: Length:
|
|
# DWARF-NEXT: Format: DWARF32
|
|
# DWARF-NEXT: Version: 5
|
|
# DWARF: Augmentation: ''
|