[Lldb-commits] [lldb] Fix GetDIE is outside of its CU error from .debug_names (PR #157574)

David Peixotto via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 10 18:50:30 PDT 2025


================
@@ -0,0 +1,19 @@
+/// Check that LLDB does not emit "GetDIE for DIE {{0x[0-9a-f]+}} is outside of its CU"
+/// error message when user is searching for a matching symbol from .debug_names
+/// and fail to locate the corresponding .dwo file.
+
+/// -gsplit-dwarf is supported only on Linux.
+// REQUIRES: system-linux
+
+// RUN: %clang_host -g -gsplit-dwarf -gpubnames -gdwarf-5 %s -o main
----------------
dmpots wrote:

Thanks the test looks much easier to understand now.

I think there is a problem with where it is writing the files though. The lit tests to not automatically get a unique build directory for the test outputs, but uses a shared directory for all the tests in that directory. That means writing and deleting files can interfere with other tests in the directory.

We can use the [%t](https://llvm.org/docs/CommandGuide/lit.html#substitutions) to create unique a temporary directory for the test.

```
// RUN: mkdir -p %t.dir
// RUN: %clang_host -g -gsplit-dwarf -gpubnames -gdwarf-5 %s -o %t.dir/main
// RUN: rm %t.dir/*.dwo
// RUN: %lldb --no-lldbinit %t.dir/main \
// RUN:   -o "b main" --batch 2>&1 | FileCheck %s
```

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


More information about the lldb-commits mailing list