| 1 | /// Check that LLDB uses the paths in target.debug-file-search-paths to find |
| 2 | /// split DWARF files with DW_AT_comp_dir set to some non-relative path, when |
| 3 | /// the program file and DWO have been moved and/or we're executing from another |
| 4 | /// directory. Specifically when the DWO is not at it's "name", here we move |
| 5 | /// it to %t.compdir/main-main.dwo and it's name is c/d/main-main.dwo. |
| 6 | // UNSUPPORTED: system-darwin |
| 7 | // 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.c |
| 10 | // RUN: cd %t.compdir/a/b/ |
| 11 | /// The produced DWO is named c/d/main-main.dwo, with a non-relative |
| 12 | /// DW_AT_comp_dir of <pathtobuild>/a/b |
| 13 | // RUN: %clang_host -g -gsplit-dwarf c/d/main.c -o c/d/main |
| 14 | // RUN: cd ../../.. |
| 15 | /// Move the program. |
| 16 | // RUN: mv %t.compdir/a/b/c/d/main %t.compdir/a/ |
| 17 | /// Move the DWO. |
| 18 | // RUN: mv %t.compdir/a/b/c/d/*.dwo %t.compdir |
| 19 | /// Debug it from yet another path. |
| 20 | // RUN: mkdir -p %t.e/ |
| 21 | // RUN: cd %t.e |
| 22 | /// LLDB should find in %t.compdir. |
| 23 | // RUN: %lldb --no-lldbinit %t.compdir/a/main \ |
| 24 | // RUN: -O "settings append target.debug-file-search-paths %t.compdir" \ |
| 25 | // RUN: -o "b main" -o "run" -o "p num" --batch 2>&1 | FileCheck %s |
| 26 | |
| 27 | // CHECK-NOT: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded. |
| 28 | // CHECK: (int) 5 |
| 29 | |
| 30 | int num = 5; |
| 31 | |
| 32 | int main(void) { return 0; } |