| 1 | /// Check that when LLDB is looking for a relative DWO it uses the debug search |
| 2 | /// paths setting. If it doesn't find it by adding the whole relative path to |
| 3 | /// of DWO it should try adding just the filename (e.g. main.dwo) to each debug |
| 4 | /// search path. |
| 5 | // UNSUPPORTED: system-darwin |
| 6 | // RUN: rm -rf %t.compdir/ |
| 7 | // RUN: mkdir -p %t.compdir/a/b/ |
| 8 | // RUN: cp %s %t.compdir/a/b/main.c |
| 9 | // RUN: cd %t.compdir/a/ |
| 10 | /// The produced DWO is named /b/main-main.dwo, with a DW_AT_comp_dir of a/. |
| 11 | // RUN: %clang_host -g -gsplit-dwarf -fdebug-prefix-map=%t.compdir=. b/main.c -o b/main |
| 12 | // RUN: cd ../.. |
| 13 | /// Move the DWO file away from the expected location. |
| 14 | // RUN: mv %t.compdir/a/b/*.dwo %t.compdir/ |
| 15 | /// LLDB won't find the DWO next to the binary or by adding the relative path |
| 16 | /// to any of the search paths. So it should find the DWO file at |
| 17 | /// %t.compdir/main-main.dwo. |
| 18 | // RUN: %lldb --no-lldbinit %t.compdir/a/b/main \ |
| 19 | // RUN: -O "settings append target.debug-file-search-paths %t.compdir" \ |
| 20 | // RUN: -o "b main" -o "run" -o "p num" --batch 2>&1 | FileCheck %s |
| 21 | |
| 22 | // CHECK-NOT: warning: {{.*}}main unable to locate separate debug file (dwo, dwp). Debugging will be degraded. |
| 23 | // CHECK: (int) 5 |
| 24 | |
| 25 | int num = 5; |
| 26 | |
| 27 | int main(void) { return 0; } |