[Lldb-commits] [lldb] [lldb] Fix a crash when using .dwp files and make type lookup reliable with the index cache (PR #79544)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 31 10:51:43 PST 2024


================
@@ -1,15 +1,88 @@
 // REQUIRES: lld
 
-// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -g -c %s -o %t.o
-// RUN: ld.lld %t.o -o %t
-// RUN: llvm-dwp %t.dwo -o %t.dwp
-// RUN: rm %t.dwo
-// RUN: llvm-objcopy --only-keep-debug %t %t.debug
-// RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.debug %t
-// RUN: %lldb %t -o "target variable a" -b | FileCheck %s
+// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-5 -c %s -o %t.dwarf5.o
+// RUN: ld.lld %t.dwarf5.o -o %t.dwarf5
+// RUN: llvm-dwp %t.dwarf5.dwo -o %t.dwarf5.dwp
+// RUN: rm %t.dwarf5.dwo
+// RUN: llvm-objcopy --only-keep-debug %t.dwarf5 %t.dwarf5.debug
+// RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.dwarf5.debug %t.dwarf5
+// RUN: %lldb %t.dwarf5 -o "target variable a" -b | FileCheck %s
+
+// Run one time with the index cache enabled to populate the index cache. When
+// we populate the index cache we have to parse all of the DWARF debug info
+// and it is always available.
+// RUN: rm -rf %T/lldb-index-cache
----------------
adrian-prantl wrote:

%T is the parent dir of %t. That sounds dangerous because multiple parallel tests could write an lldb-index-cache there and create nondeterministic result. Could you move the index cache into a test-specific dir like `mkdir -p %t`?

https://github.com/llvm/llvm-project/pull/79544


More information about the lldb-commits mailing list