| 1 | /// Check that LLDB uses the paths in target.debug-file-search-paths to find |
| 2 | /// split DWARF files with a relative DW_AT_comp_dir set, when the program file |
| 3 | /// has been moved and/or we're executing it from another directory. |
| 4 | // UNSUPPORTED: system-darwin |
| 5 | // RUN: rm -rf %t.compdir/ %t.e/ |
| 6 | // RUN: mkdir -p %t.compdir/a/b/c/d/ |
| 7 | // RUN: cp %s %t.compdir/a/b/c/d/main.c |
| 8 | // RUN: cd %t.compdir/a/b/ |
| 9 | /// The produced DWO is named c/d/main-main.dwo, with a DW_AT_comp_dir of a/b. |
| 10 | // RUN: %clang_host -g -gsplit-dwarf -fdebug-prefix-map=%t.compdir=. c/d/main.c -o c/d/main |
| 11 | // RUN: cd ../../.. |
| 12 | /// Move only the program, leaving the DWO file in place. |
| 13 | // RUN: mv %t.compdir/a/b/c/d/main %t.compdir/a/ |
| 14 | /// Debug it from yet another path. |
| 15 | // RUN: mkdir -p %t.e/ |
| 16 | // RUN: cd %t.e |
| 17 | /// LLDB won't find the DWO next to the binary or in the current dir, so it |
| 18 | /// should find the DWO file by doing %t.compdir/ + a/b/ + c/d/main-main.dwo. |
| 19 | // RUN: %lldb --no-lldbinit %t.compdir/a/main \ |
| 20 | // RUN: -O "settings append target.debug-file-search-paths %t.compdir" \ |
| 21 | // RUN: -o "b main" -o "run" -o "p num" --batch 2>&1 | FileCheck %s |
| 22 | |
| 23 | // CHECK-NOT: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded. |
| 24 | // CHECK: (int) 5 |
| 25 | |
| 26 | int num = 5; |
| 27 | |
| 28 | int main(void) { return 0; } |
| 29 | |