|
1 | 1 | // REQUIRES: lld
|
2 | 2 |
|
| 3 | +// Now test with DWARF5 |
3 | 4 | // RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-5 -c %s -o %t.dwarf5.o
|
4 | 5 | // RUN: ld.lld %t.dwarf5.o -o %t.dwarf5
|
5 | 6 | // RUN: llvm-dwp %t.dwarf5.dwo -o %t.dwarf5.dwp
|
6 | 7 | // RUN: rm %t.dwarf5.dwo
|
7 | 8 | // RUN: llvm-objcopy --only-keep-debug %t.dwarf5 %t.dwarf5.debug
|
8 | 9 | // RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.dwarf5.debug %t.dwarf5
|
9 |
| -// RUN: %lldb %t.dwarf5 -o "target variable a" -b | FileCheck %s |
| 10 | +// RUN: %lldb \ |
| 11 | +// RUN: -O "log enable dwarf split" \ |
| 12 | +// RUN: -o "target variable a" \ |
| 13 | +// RUN: -b %t.dwarf5 | FileCheck %s |
10 | 14 |
|
11 | 15 | // Run one time with the index cache enabled to populate the index cache. When
|
12 | 16 | // we populate the index cache we have to parse all of the DWARF debug info
|
|
34 | 38 | // RUN: -o "statistics dump" \
|
35 | 39 | // RUN: %t.dwarf5 -b | FileCheck %s -check-prefix=CACHED
|
36 | 40 |
|
| 41 | +// Make sure that if we load the "%t.dwarf5.debug" file, that we can find and |
| 42 | +// load the .dwo file from the .dwp when it is "%t.dwarf5.dwp" |
| 43 | +// RUN: %lldb %t.dwarf5.debug -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 44 | + |
| 45 | +// Make sure that if we load the "%t.dwarf5" file, that we can find and |
| 46 | +// load the .dwo file from the .dwp when it is "%t.dwarf5.debug.dwp" |
| 47 | +// RUN: mv %t.dwarf5.dwp %t.dwarf5.debug.dwp |
| 48 | +// RUN: %lldb %t.dwarf5 -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 49 | + |
| 50 | +// Make sure that if we load the "%t.dwarf5.debug" file, that we can find and |
| 51 | +// load the .dwo file from the .dwp when it is "%t.dwarf5.debug.dwp" |
| 52 | +// RUN: %lldb %t.dwarf5.debug -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 53 | + |
| 54 | +// Make sure that if we remove the .dwp file we see an appropriate error. |
| 55 | +// RUN: rm %t.dwarf5.debug.dwp |
| 56 | +// RUN: %lldb \ |
| 57 | +// RUN: -O "log enable dwarf split" \ |
| 58 | +// RUN: -o "b main" \ |
| 59 | +// RUN: -b %t.dwarf5 2>&1 | FileCheck %s -check-prefix=NODWP |
| 60 | + |
| 61 | +// RUN: %lldb \ |
| 62 | +// RUN: -O "log enable dwarf split" \ |
| 63 | +// RUN: -o "b main" \ |
| 64 | +// RUN: -b %t.dwarf5.debug 2>&1 | FileCheck %s -check-prefix=NODWP |
| 65 | + |
37 | 66 | // Now test with DWARF4
|
38 | 67 | // RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-4 -c %s -o %t.dwarf4.o
|
39 | 68 | // RUN: ld.lld %t.dwarf4.o -o %t.dwarf4
|
40 | 69 | // RUN: llvm-dwp %t.dwarf4.dwo -o %t.dwarf4.dwp
|
41 | 70 | // RUN: rm %t.dwarf4.dwo
|
42 | 71 | // RUN: llvm-objcopy --only-keep-debug %t.dwarf4 %t.dwarf4.debug
|
43 | 72 | // RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.dwarf4.debug %t.dwarf4
|
44 |
| -// RUN: %lldb %t.dwarf4 -o "target variable a" -b | FileCheck %s |
| 73 | +// RUN: %lldb \ |
| 74 | +// RUN: -O "log enable dwarf split" \ |
| 75 | +// RUN: -o "target variable a" \ |
| 76 | +// RUN: -b %t.dwarf4 | FileCheck %s |
45 | 77 |
|
46 | 78 | // Run one time with the index cache enabled to populate the index cache. When
|
47 | 79 | // we populate the index cache we have to parse all of the DWARF debug info
|
|
69 | 101 | // RUN: -o "statistics dump" \
|
70 | 102 | // RUN: %t.dwarf4 -b | FileCheck %s -check-prefix=CACHED
|
71 | 103 |
|
| 104 | +// Make sure that if we load the "%t.dwarf4.debug" file, that we can find and |
| 105 | +// load the .dwo file from the .dwp when it is "%t.dwarf4.dwp" |
| 106 | +// RUN: %lldb %t.dwarf4.debug -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 107 | + |
| 108 | +// Make sure that if we load the "%t.dwarf4" file, that we can find and |
| 109 | +// load the .dwo file from the .dwp when it is "%t.dwarf4.debug.dwp" |
| 110 | +// RUN: mv %t.dwarf4.dwp %t.dwarf4.debug.dwp |
| 111 | +// RUN: %lldb %t.dwarf4 -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 112 | + |
| 113 | +// Make sure that if we load the "%t.dwarf4.debug" file, that we can find and |
| 114 | +// load the .dwo file from the .dwp when it is "%t.dwarf4.debug.dwp" |
| 115 | +// RUN: %lldb %t.dwarf4.debug -o "b main" -b | FileCheck %s -check-prefix=DEBUG |
| 116 | + |
| 117 | +// Make sure that if we remove the .dwp file we see an appropriate error. |
| 118 | +// RUN: rm %t.dwarf4.debug.dwp |
| 119 | +// RUN: %lldb \ |
| 120 | +// RUN: -O "log enable dwarf split" \ |
| 121 | +// RUN: -o "b main" \ |
| 122 | +// RUN: -b %t.dwarf4 2>&1 | FileCheck %s -check-prefix=NODWP |
| 123 | + |
| 124 | +// RUN: %lldb \ |
| 125 | +// RUN: -O "log enable dwarf split" \ |
| 126 | +// RUN: -o "b main" \ |
| 127 | +// RUN: -b %t.dwarf4.debug 2>&1 | FileCheck %s -check-prefix=NODWP |
| 128 | + |
| 129 | +// Test if we have a GNU build ID in our main executable and in our debug file, |
| 130 | +// and we have a .dwp file that doesn't, that we can still load our .dwp file. |
| 131 | +// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-5 -c %s -o %t.o |
| 132 | +// RUN: ld.lld %t.o --build-id=md5 -o %t |
| 133 | +// RUN: llvm-dwp %t.dwo -o %t.dwp |
| 134 | +// RUN: rm %t.dwo |
| 135 | +// RUN: llvm-objcopy --only-keep-debug %t %t.debug |
| 136 | +// RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.debug %t |
| 137 | +// RUN: %lldb \ |
| 138 | +// RUN: -O "log enable dwarf split" \ |
| 139 | +// RUN: -o "target variable a" \ |
| 140 | +// RUN: -b %t | FileCheck %s |
| 141 | + |
| 142 | +// CHECK: Searching for DWP using: |
| 143 | +// CHECK: Found DWP file: |
72 | 144 | // CHECK: (A) a = (x = 47)
|
73 | 145 |
|
74 | 146 | // CACHE: script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)
|
|
83 | 155 | // CACHED-NEXT: }
|
84 | 156 | // CACHED: "totalDebugInfoIndexLoadedFromCache": 1
|
85 | 157 |
|
| 158 | +// Make sure debug information was loaded by verifying that the |
| 159 | +// DEBUG: Breakpoint 1: where = dwp-separate-debug-file.cpp.tmp.dwarf{{[45]}}{{(\.debug)?}}`main + {{[0-9]+}} at dwp-separate-debug-file.cpp:{{[0-9]+}}:{{[0-9]+}}, address = {{0x[0-9a-fA-F]+}} |
| 160 | + |
| 161 | +// Make sure if we load the stripped binary or the debug info file with no .dwp |
| 162 | +// nor any .dwo files that we are not able to fine the .dwp or .dwo files. |
| 163 | +// NODWP: Searching for DWP using: |
| 164 | +// NODWP: Searching for DWP using: |
| 165 | +// NODWP: Unable to locate for DWP file for: |
| 166 | +// NODWP: unable to locate separate debug file (dwo, dwp). Debugging will be degraded. |
| 167 | + |
86 | 168 | struct A {
|
87 | 169 | int x = 47;
|
88 | 170 | };
|
|
0 commit comments