33 lines · c
1/// Check that LLDB uses the paths in target.debug-file-search-paths to find2/// split DWARF files with DW_AT_comp_dir set to some absolute path, when3/// the program file and DWO have been moved and/or we're executing from4/// another directory. Specifically when the DWO has been moved to another5/// directory but is still at it's name. Here, %t.compdir/c/d/main-main.dwo.6// UNSUPPORTED: system-darwin7// RUN: rm -rf %t.compdir/ %t.e/8// RUN: mkdir -p %t.compdir/a/b/c/d/9// RUN: cp %s %t.compdir/a/b/c/d/main.c10// RUN: cd %t.compdir/a/b/11/// The produced DWO is named c/d/main-main.dwo, with a non-relative12/// DW_AT_comp_dir of <pathtobuild>/a/b13// RUN: %clang_host -g -gsplit-dwarf c/d/main.c -o c/d/main14// RUN: cd ../../..15/// Move the program.16// RUN: mv %t.compdir/a/b/c/d/main %t.compdir/a/17/// Move the DWO but keep it at the path in in its name.18// RUN: mkdir -p %t.compdir/c/d/19// RUN: mv %t.compdir/a/b/c/d/*.dwo %t.compdir/c/d/20/// Debug it from yet another path.21// RUN: mkdir -p %t.e/22// RUN: cd %t.e23/// LLDB should find in %t.compdir.24// RUN: %lldb --no-lldbinit %t.compdir/a/main \25// RUN: -O "settings append target.debug-file-search-paths %t.compdir" \26// RUN: -o "b main" -o "run" -o "p num" --batch 2>&1 | FileCheck %s27 28// CHECK-NOT: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded.29// CHECK: (int) 530 31int num = 5;32 33int main(void) { return 0; }