|
1 | 1 | // REQUIRES: lld
|
2 | 2 |
|
3 |
| -// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -g -c %s -o %t.o |
4 |
| -// RUN: ld.lld %t.o -o %t |
5 |
| -// RUN: llvm-dwp %t.dwo -o %t.dwp |
6 |
| -// RUN: rm %t.dwo |
7 |
| -// RUN: llvm-objcopy --only-keep-debug %t %t.debug |
8 |
| -// RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t.debug %t |
9 |
| -// RUN: %lldb %t -o "target variable a" -b | FileCheck %s |
| 3 | +// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-5 -c %s -o %t.dwarf5.o |
| 4 | +// RUN: ld.lld %t.dwarf5.o -o %t.dwarf5 |
| 5 | +// RUN: llvm-dwp %t.dwarf5.dwo -o %t.dwarf5.dwp |
| 6 | +// RUN: rm %t.dwarf5.dwo |
| 7 | +// RUN: llvm-objcopy --only-keep-debug %t.dwarf5 %t.dwarf5.debug |
| 8 | +// 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 | 10 |
|
11 | 11 | // Run one time with the index cache enabled to populate the index cache. When
|
12 | 12 | // we populate the index cache we have to parse all of the DWARF debug info
|
|
18 | 18 | // RUN: -O 'settings set target.preload-symbols false' \
|
19 | 19 | // RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
|
20 | 20 | // RUN: -o "statistics dump" \
|
21 |
| -// RUN: %t -b | FileCheck %s -check-prefix=CACHE |
| 21 | +// RUN: %t.dwarf5 -b | FileCheck %s -check-prefix=CACHE |
22 | 22 |
|
23 | 23 | // Run again after index cache was enabled, which load the index cache. When we
|
24 | 24 | // load the index cache from disk, we don't have any DWARF parsed yet and this
|
|
32 | 32 | // RUN: -O 'settings set target.preload-symbols false' \
|
33 | 33 | // RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \
|
34 | 34 | // RUN: -o "statistics dump" \
|
35 |
| -// RUN: %t -b | FileCheck %s -check-prefix=CACHED |
| 35 | +// RUN: %t.dwarf5 -b | FileCheck %s -check-prefix=CACHED |
| 36 | + |
| 37 | +// Now test with DWARF4 |
| 38 | +// RUN: %clang -target x86_64-pc-linux -gsplit-dwarf -gdwarf-4 -c %s -o %t.dwarf4.o |
| 39 | +// RUN: ld.lld %t.dwarf4.o -o %t.dwarf4 |
| 40 | +// RUN: llvm-dwp %t.dwarf4.dwo -o %t.dwarf4.dwp |
| 41 | +// RUN: rm %t.dwarf4.dwo |
| 42 | +// RUN: llvm-objcopy --only-keep-debug %t.dwarf4 %t.dwarf4.debug |
| 43 | +// 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 |
| 45 | + |
| 46 | +// Run one time with the index cache enabled to populate the index cache. When |
| 47 | +// we populate the index cache we have to parse all of the DWARF debug info |
| 48 | +// and it is always available. |
| 49 | +// RUN: rm -rf %T/lldb-index-cache |
| 50 | +// RUN: %lldb \ |
| 51 | +// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \ |
| 52 | +// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \ |
| 53 | +// RUN: -O 'settings set target.preload-symbols false' \ |
| 54 | +// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \ |
| 55 | +// RUN: -o "statistics dump" \ |
| 56 | +// RUN: %t.dwarf4 -b | FileCheck %s -check-prefix=CACHE |
| 57 | + |
| 58 | +// Run again after index cache was enabled, which load the index cache. When we |
| 59 | +// load the index cache from disk, we don't have any DWARF parsed yet and this |
| 60 | +// can cause us to try and access information in the .dwp directly without |
| 61 | +// parsing the .debug_info, but this caused crashes when the DWO files didn't |
| 62 | +// have a backlink to the skeleton compile unit. This test verifies that we |
| 63 | +// don't crash and that we can find types when using .dwp files. |
| 64 | +// RUN: %lldb \ |
| 65 | +// RUN: -O 'settings set symbols.enable-lldb-index-cache true' \ |
| 66 | +// RUN: -O 'settings set symbols.lldb-index-cache-path %T/lldb-index-cache' \ |
| 67 | +// RUN: -O 'settings set target.preload-symbols false' \ |
| 68 | +// RUN: -o "script lldb.target.modules[0].FindTypes('::A').GetTypeAtIndex(0)" \ |
| 69 | +// RUN: -o "statistics dump" \ |
| 70 | +// RUN: %t.dwarf4 -b | FileCheck %s -check-prefix=CACHED |
36 | 71 |
|
37 | 72 | // CHECK: (A) a = (x = 47)
|
38 | 73 |
|
|
0 commit comments