Eric Leese 8dfd6cae9b [lldb] [DWARF-5] Be lazier about loading .dwo files
This change makes sure that DwarfUnit does not load a .dwo file until
necessary. I also take advantage of DWARF 5's guarantee that the first
support file is also the primary file to make it possible to create
a compile unit without loading the .dwo file.

Review By: jankratochvil, dblaikie

Differential Revision: https://reviews.llvm.org/D100299
2021-07-30 23:17:06 +02:00

23 lines
871 B
C

// Test that optimized flag is properly included in DWARF.
// ObjectFileELF::ApplyRelocations does not implement arm32.
// XFAIL: target-arm && linux-gnu
// RUN: %clang_host %s -fno-standalone-debug -glldb \
// RUN: -gdwarf-5 -gpubnames -gsplit-dwarf -O3 -c -o %t1.o
// RUN: llvm-dwarfdump %t1.o | FileCheck %s --check-prefix DWARFDUMP_O
// RUN: llvm-dwarfdump %t1.dwo | FileCheck %s --check-prefix DWARFDUMP_DWO
// RUN: %lldb -b -o 'script lldb.SBDebugger.Create().CreateTarget("%t1.o").FindFunctions("main",lldb.eFunctionNameTypeAuto).GetContextAtIndex(0).GetFunction().GetIsOptimized()' | FileCheck %s
// DWARFDUMP_O-NOT: DW_AT_APPLE_optimized
//
// DWARFDUMP_DWO: DW_TAG_compile_unit
// DWARFDUMP_DWO-NOT: DW_TAG_
// DWARFDUMP_DWO: DW_AT_APPLE_optimized (true)
// CHECK: (lldb) script lldb.SBDebugger.Create()
// CHECK-NEXT: True
int main(void) { return 0; }