32 lines · c
1/// Check that LLDB uses the paths in target.debug-file-search-paths to find2/// split DWARF files with a relative DW_AT_comp_dir set, when the program file3/// has been moved and/or we're executing it from another directory. Even when4/// the provided search path is actually a symlink to the real location.5// UNSUPPORTED: system-darwin6// UNSUPPORTED: system-windows7// 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 DW_AT_comp_dir of a/b.12// RUN: %clang_host -g -gsplit-dwarf -fdebug-prefix-map=%t.compdir=. c/d/main.c -o c/d/main13// RUN: cd ../../..14/// Move only the program, leaving the DWO file in place.15// RUN: mv %t.compdir/a/b/c/d/main %t.compdir/a/16/// Create a symlink to the compliation dir, to use instead of the real path.17// RUN: ln -s %t.compdir %t.symlink_to_compdir18/// Debug it from yet another path.19// RUN: mkdir -p %t.e/20// RUN: cd %t.e21/// DWO should be found by following using symlink + a/b/ + c/d/main-main.dwo.22// RUN: %lldb --no-lldbinit %t.compdir/a/main \23// RUN: -O "settings append target.debug-file-search-paths %t.symlink_to_compdir" \24// RUN: -o "b main" -o "run" -o "p num" --batch 2>&1 | FileCheck %s25 26// CHECK-NOT: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded.27// CHECK: (int) 528 29int num = 5;30 31int main(void) { return 0; }32