Skip to content

Commit d5ea702

Browse files
author
Kevin Frei
committed
Cleaned up tests comments-n-stuff
1 parent e74c605 commit d5ea702

18 files changed

+207
-252
lines changed

lldb/test/Shell/Debuginfod/tests.md renamed to lldb/test/Shell/Debuginfod/Debuginfod-testing.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,36 @@ files we need for testing.
1010

1111
- For assumption validation, the `*-no-locator` tests verify that lldb works as
1212
the test expects when files that Debuginfod should provide (`.dwp` files,
13-
`.gnu.debuglink`'ed files) are _already_ there.
13+
`.gnu.debuglink`'ed files, etc...) are _already_ there.
1414
- The `*-negative` tests validate that symbols _aren't_ found without
15-
Debuginfod, to ensure they haven't been cached from previous runs.
16-
- The `*-positive` tests check that the Debuginfod symbol locator is providing
15+
Debuginfod, to ensure they haven't been cached from previous runs (in the
16+
hopes of preventing false positive testing).
17+
- The `*-positive*` tests check that the Debuginfod symbol locator is providing
1718
the expected symbols when the debugger doesn't already have them available.
1819

1920
### Symbol file variations tested
2021

21-
There are 5 variations of symbol data where Debuginfod can provide value:
22+
There are 5 variations of symbol data where Debuginfod provides value:
2223

23-
1. The 'simple-stripped' build variation is a binary built with debug
24-
information (`-g`), but stripped for deployment. A Debuginfod service can
25-
then host the unstripped binary (as either `executable` or `debuginfo`).
26-
2. The 'okd-stripped' build variation is a binary build with `-g`, stripped for
24+
1. The `strip` build variation is a binary built with debug information (`-g`),
25+
but stripped for deployment. The Debuginfod service can then host the
26+
unstripped binary (as either `executable` or `debuginfo`).
27+
2. The `okdstrip` build variation is a binary build with `-g`, stripped for
2728
deployment, where the Debuginfod service is hosting the output of
2829
`objcopy --only-keep-debug` (which should also be linked to the stripped file
2930
using `--add-gnu-debuglink`). Again, the file could be hosted as either
3031
`executable` or `debuginfo`.
31-
3. The 'simple-split' build variation is a binary built with `-gsplit-dwarf`
32-
that produces `.dwo` which are subsequently linked together (using
33-
`llvm-dwp`) into a single `.dwp` file. The Debuginfod service should host the
34-
`.dwp` file as `debuginfo`.
35-
4. **The 'stripped-split' build variation is a binary built with `-gsplit-dwarf`,
32+
3. The `split` build variation is a binary built with `-gsplit-dwarf` that
33+
produces `.dwo` which are subsequently linked together (using `llvm-dwp`)
34+
into a single `.dwp` file. The Debuginfod service hosts the `.dwp` file as
35+
`debuginfo`.
36+
4. The `split-strip` build variation is a binary built with `-gsplit-dwarf`,
3637
then stripped in the same manner as variation #1. For this variation,
37-
Debuginfod should host the unstripped binary as `executable` and the `.dwp`
38-
file as `debuginfo`.**
39-
5. The 'okd-stripped-split' build variation is the combination of variations 2
40-
and 3, where Debuginfod hosts the `.gnu.debuglink`'ed file as `executable`
41-
and the `.dwp` again as `debuginfo`.
38+
Debuginfod hosts the unstripped binary as `executable` and the `.dwp` file as
39+
`debuginfo`.
40+
5. The `split-okdstrip` build variation is the combination of variations 2 and
41+
3, where Debuginfod hosts the `.gnu.debuglink`'ed file as `executable` and
42+
the `.dwp` as `debuginfo`.
4243

4344
### Lack of clarity/messy capabilities from Debuginfod
4445

lldb/test/Shell/Debuginfod/okdstrip-negative.test

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 2 negative:
4+
# * A stripped binary, with an "-only-keep-debug" symbols which is *not* there.
5+
# * LLDB should fail to find the OKD file automatically using .gnu.debuglink.
46

5-
# RUN: mkdir -p %t/output
7+
# RUN: rm -rf %t
8+
# RUN: mkdir -p %t
69

7-
# Scenario 2
8-
# A stripped binary, with an "-only-keep-debug" symbols which is *not* there.
9-
# LLDB should fail to find the OKD file automatically using .gnu.debuglink
10-
11-
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/output/bin-stripped.tmp
12-
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/output/bin-stripped.dbg
13-
# RUN: llvm-objcopy %t/output/bin-stripped.tmp --add-gnu-debuglink=%t/output/bin-stripped.dbg %t/output/bin-stripped
14-
# Don't leave the stripped .dbg file laying around for the debugger to discover
15-
# RUN: rm %t/output/bin-stripped.dbg
16-
# RUN: chmod a+x %t/output/bin-stripped
17-
18-
# Verify that we find symbols from the Debuginfod service
10+
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/bin-stripped.tmp
11+
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/bin-stripped.dbg
12+
# RUN: llvm-objcopy %t/bin-stripped.tmp --add-gnu-debuglink=%t/bin-stripped.dbg %t/bin-stripped
13+
# RUN: rm %t/bin-stripped.dbg
14+
# RUN: chmod a+x %t/bin-stripped
1915

2016
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
21-
# RUN: -o "target create %t/output/bin-stripped" \
17+
# RUN: -o "target create %t/bin-stripped" \
2218
# RUN: -o "b func" \
2319
# RUN: -o "quit" \
2420
# RUN: 2>&1 | FileCheck %s
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 2 baseline:
4+
# * A stripped binary, with an "-only-keep-debug" symbols file.
5+
# * LLDB should find the OKD file automatically using .gnu.debuglink.
46

5-
# RUN: mkdir -p %t/output
7+
# RUN: rm -rf %t
8+
# RUN: mkdir -p %t
69

7-
# Scenario 2
8-
# A stripped binary, with an "-only-keep-debug" symbols
9-
# LLDB should find the OKD file automatically using .gnu.debuglink
10-
11-
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/output/bin-stripped.tmp
12-
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/output/bin-stripped.dbg
13-
# RUN: llvm-objcopy %t/output/bin-stripped.tmp --add-gnu-debuglink=%t/output/bin-stripped.dbg %t/output/bin-stripped
14-
# RUN: chmod a+x %t/output/bin-stripped
15-
16-
# Verify that we find symbols from the Debuginfod service
10+
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/bin-stripped.tmp
11+
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/bin-stripped.dbg
12+
# RUN: llvm-objcopy %t/bin-stripped.tmp --add-gnu-debuglink=%t/bin-stripped.dbg %t/bin-stripped
13+
# RUN: chmod a+x %t/bin-stripped
1714

1815
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
19-
# RUN: -o "target create %t/output/bin-stripped" \
16+
# RUN: -o "target create %t/bin-stripped" \
2017
# RUN: -o "b func" \
2118
# RUN: -o "quit" \
2219
# RUN: 2>&1 | FileCheck %s
2320

24-
# Should have source file information:
25-
21+
# Should have source file and line information:
2622
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 2a:
4+
# A stripped binary, with an "-only-keep-debug" symbols file.
5+
# LLDB should request the symbols from Debuginfod as 'debuginfo'.
46

5-
# RUN: mkdir -p %t/output
7+
# Set up a file-system 'hosted' Debuginfod server.
8+
# RUN: rm -rf %t
69
# RUN: mkdir -p %t/cache
710
# RUN: mkdir -p %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d
811

9-
# Scenario 2a
10-
# A stripped binary, with an "-only-keep-debug" symbols file
11-
# LLDB should request the symbols from Debuginfod as 'debuginfo'
12-
13-
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/output/bin-stripped.tmp
14-
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/output/bin-stripped.dbg
15-
# RUN: llvm-objcopy %t/output/bin-stripped.tmp --add-gnu-debuglink=%t/output/bin-stripped.dbg %t/output/bin-stripped
16-
# Move the stripped .dbg into the file:// hosted Debuginfod location
17-
# RUN: mv %t/output/bin-stripped.dbg %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d/debuginfo
18-
# RUN: chmod a+x %t/output/bin-stripped
19-
20-
# Verify that we find symbols from the Debuginfod service
12+
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/bin-stripped.tmp
13+
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/bin-stripped.dbg
14+
# RUN: llvm-objcopy %t/bin-stripped.tmp --add-gnu-debuglink=%t/bin-stripped.dbg %t/bin-stripped
15+
# RUN: mv %t/bin-stripped.dbg %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d/debuginfo
16+
# RUN: chmod a+x %t/bin-stripped
2117

2218
# RUN: %lldb -o "settings set symbols.enable-external-lookup true" \
2319
# RUN: -o "settings set plugin.symbol-locator.debuginfod.cache-path %t/cache" \
2420
# RUN: -o "settings clear plugin.symbol-locator.debuginfod.server-urls" \
2521
# RUN: -o "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%t" \
26-
# RUN: -o "target create %t/output/bin-stripped" \
22+
# RUN: -o "target create %t/bin-stripped" \
2723
# RUN: -o "b func" \
2824
# RUN: -o "quit" \
2925
# RUN: 2>&1 | FileCheck %s
3026

31-
# Should have source file information:
32-
27+
# Should have source file and line information:
3328
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}
Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 2b:
4+
# A stripped binary, with an "-only-keep-debug" symbols file.
5+
# LLDB should request the symbols from Debuginfod as 'executable'.
46

5-
# RUN: mkdir -p %t/output
7+
# Set up a file-system 'hosted' Debuginfod server.
8+
# RUN: rm -rf %t
69
# RUN: mkdir -p %t/cache
710
# RUN: mkdir -p %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d
811

9-
# Scenario 2b
10-
# A stripped binary, with an "-only-keep-debug" symbols file
11-
# LLDB should request the symbols from Debuginfod as 'executable'
12-
13-
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/output/bin-stripped.tmp
14-
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/output/bin-stripped.dbg
15-
# RUN: llvm-objcopy %t/output/bin-stripped.tmp --add-gnu-debuglink=%t/output/bin-stripped.dbg %t/output/bin-stripped
16-
# Move the stripped .dbg into the file:// hosted Debuginfod location
17-
# RUN: mv %t/output/bin-stripped.dbg %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d/executable
18-
# RUN: chmod a+x %t/output/bin-stripped
19-
20-
# Verify that we find symbols from the Debuginfod service
12+
# RUN: yaml2obj %p/Inputs/bin-stripped.yaml -o %t/bin-stripped.tmp
13+
# RUN: yaml2obj %p/Inputs/sym-stripped.yaml -o %t/bin-stripped.dbg
14+
# RUN: llvm-objcopy %t/bin-stripped.tmp --add-gnu-debuglink=%t/bin-stripped.dbg %t/bin-stripped
15+
# RUN: mv %t/bin-stripped.dbg %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d/executable
16+
# RUN: chmod a+x %t/bin-stripped
2117

2218
# RUN: %lldb -o "settings set symbols.enable-external-lookup true" \
2319
# RUN: -o "settings set plugin.symbol-locator.debuginfod.cache-path %t/cache" \
2420
# RUN: -o "settings clear plugin.symbol-locator.debuginfod.server-urls" \
2521
# RUN: -o "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%t" \
26-
# RUN: -o "target create %t/output/bin-stripped" \
22+
# RUN: -o "target create %t/bin-stripped" \
2723
# RUN: -o "b func" \
2824
# RUN: -o "quit" \
2925
# RUN: 2>&1 | FileCheck %s
3026

31-
# Should have source file information:
32-
27+
# Should have source file and line information:
3328
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 3 negative:
4+
# * A split-dwarf binary with a *missing* .dwp file (validate nothing's cached).
45

5-
# RUN: mkdir -p %t/output
6+
# RUN: rm -rf %t
7+
# RUN: mkdir -p %t
68

7-
# Scenario 3: No locator
8-
# A split binary, with a *missing* .dwp file
9-
10-
# RUN: yaml2obj %p/Inputs/bin-split.yaml -o %t/output/bin-split
11-
# RUN: chmod a+x %t/output/bin-split
12-
13-
# Negative test (We don't find symbols without the Debuginfod service)
9+
# RUN: yaml2obj %p/Inputs/bin-split.yaml -o %t/bin-split
10+
# RUN: chmod a+x %t/bin-split
1411

1512
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
16-
# RUN: -o "target create %t/output/bin-split" \
13+
# RUN: -o "target create %t/bin-split" \
1714
# RUN: -o "target modules dump separate-debug-info" \
1815
# RUN: -o "quit" \
1916
# RUN: 2>&1 | FileCheck %s
@@ -22,4 +19,5 @@
2219
# CHECK-NEXT: Type: "dwo"
2320
# CHECK-NEXT: Dwo ID{{.*}}
2421
# CHECK-NEXT: {{^[- ]+$}}
22+
# Verify it's missing the DWP file (and DWOs)
2523
# CHECK-NEXT: 0x{{[0-9a-f]+.*}} unable to locate .dwo debug file {{.*}}bin-split.dwo{{.*}} for skeleton DIE 0x{{[0-9a-f]+}}
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 3 baseline:
4+
# * A split-dwarf binary with the .dwp file right next to the binary.
45

5-
# RUN: rm -rf %t || echo ok
6-
# RUN: mkdir -p %t/output
7-
# RUN: mkdir -p %t/cache
8-
# RUN: mkdir -p %t/buildid/82b2c35129dab19ad58f3dd0f426bdb0cc8aa094
6+
# RUN: rm -rf %t
7+
# RUN: mkdir -p %t
98

10-
# Scenario 3: No locator
11-
# A split binary, with a .dwp file right next to the binary
12-
13-
# RUN: yaml2obj %p/Inputs/bin-split.yaml -o %t/output/bin-split
14-
# RUN: yaml2obj %p/Inputs/bin-split-dwp.yaml -o %t/output/bin-split.dwp
15-
# RUN: chmod a+x %t/output/bin-split
9+
# RUN: yaml2obj %p/Inputs/bin-split.yaml -o %t/bin-split
10+
# RUN: yaml2obj %p/Inputs/bin-split-dwp.yaml -o %t/bin-split.dwp
11+
# RUN: chmod a+x %t/bin-split
1612

1713
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
18-
# RUN: -o "target create %t/output/bin-split" \
14+
# RUN: -o "target create %t/bin-split" \
1915
# RUN: -o "target modules dump separate-debug-info" \
2016
# RUN: -o "quit" \
2117
# RUN: 2>&1 | FileCheck %s
@@ -24,3 +20,5 @@
2420
# CHECK-NEXT: Type: "dwo"
2521
# CHECK-NEXT: Dwo ID{{.*}}
2622
# CHECK-NEXT: {{^[- ]+$}}
23+
# Verify it found the DWP file properly:
24+
# CHECK-NEXT: 0x{{[0-9a-f]+.* +}}/{{.*}}/bin-split.dwp({{.*}}bin-split.dwo){{ *$}}
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 5 negative:
4+
# * An "only-keep-debug" stripped, split binary with a _missing_
5+
# * --add-gnu-debuglink symbol file.
46

5-
# RUN: mkdir -p %t/output
7+
# RUN: rm -rf %t
8+
# RUN: mkdir -p %t
69

7-
# Scenario 4: No locator
8-
# A stripped, split binary, symbols manually added and a .dwp file right next to the binary
9-
10-
# RUN: yaml2obj %p/Inputs/bin-split-stripped.yaml -o %t/output/bin-split-stripped.tmp
11-
# RUN: yaml2obj %p/Inputs/sym-split.yaml -o %t/output/sym-split
12-
# RUN: llvm-objcopy %t/output/bin-split-stripped.tmp --add-gnu-debuglink=%t/output/sym-split %t/output/bin-split-stripped
13-
# RUN: rm %t/output/sym-split
14-
# RUN: chmod a+x %t/output/bin-split-stripped
10+
# RUN: yaml2obj %p/Inputs/bin-split-stripped.yaml -o %t/bin-split-stripped.tmp
11+
# RUN: yaml2obj %p/Inputs/sym-split.yaml -o %t/sym-split
12+
# RUN: llvm-objcopy %t/bin-split-stripped.tmp --add-gnu-debuglink=%t/sym-split %t/bin-split-stripped
13+
# RUN: rm %t/sym-split
14+
# RUN: chmod a+x %t/bin-split-stripped
1515

1616
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
17-
# RUN: -o "target create %t/output/bin-split-stripped" \
17+
# RUN: -o "target create %t/bin-split-stripped" \
1818
# RUN: -o "target modules dump separate-debug-info" \
1919
# RUN: -o "quit" \
2020
# RUN: 2>&1 | FileCheck %s
2121

22-
# CHECK: Current executable set to {{.*}}.tmp/output/bin-split-stripped' (x86_64).
22+
# CHECK: Current executable set to {{.*}}/bin-split-stripped' (x86_64).
2323
# CHECK-NEXT: target modules dump separate-debug-info
2424
# CHECK-NEXT: error: no matching executable images found
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
# REQUIRES: system-linux && native && target-x86_64
22

3-
# We set up a file-system 'hosted' Debuginfod server
3+
# Scenario 5 baseline:
4+
# * A stripped, split binary, with --add-gnu-debuglink symbols automatically
5+
# * found, with a .dwp file located next to the binary.
46

5-
# RUN: mkdir -p %t/output
7+
# RUN: rm -rf %t
8+
# RUN: mkdir -p %t
69

7-
# Scenario 4: No locator
8-
# A stripped, split binary, symbols manually added and a .dwp file right next to the binary
9-
10-
# RUN: yaml2obj %p/Inputs/bin-split-stripped.yaml -o %t/output/bin-split-stripped.tmp
11-
# RUN: yaml2obj %p/Inputs/sym-split.yaml -o %t/output/sym-split
12-
# RUN: llvm-objcopy %t/output/bin-split-stripped.tmp --add-gnu-debuglink=%t/output/sym-split %t/output/bin-split-stripped
13-
# RUN: yaml2obj %p/Inputs/bin-split-dwp.yaml -o %t/output/bin-split-stripped.dwp
14-
# RUN: chmod a+x %t/output/bin-split-stripped
10+
# RUN: yaml2obj %p/Inputs/bin-split-stripped.yaml -o %t/bin-split-stripped.tmp
11+
# RUN: yaml2obj %p/Inputs/sym-split.yaml -o %t/sym-split
12+
# RUN: llvm-objcopy %t/bin-split-stripped.tmp --add-gnu-debuglink=%t/sym-split %t/bin-split-stripped
13+
# RUN: yaml2obj %p/Inputs/bin-split-dwp.yaml -o %t/bin-split-stripped.dwp
14+
# RUN: chmod a+x %t/bin-split-stripped
1515

1616
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
17-
# RUN: -o "target create %t/output/bin-split-stripped" \
17+
# RUN: -o "target create %t/bin-split-stripped" \
1818
# RUN: -o "target modules dump separate-debug-info" \
1919
# RUN: -o "quit" \
2020
# RUN: 2>&1 | FileCheck %s
2121

22-
# CHECK: Symbol file: {{.*}}/bin-split
22+
# CHECK: Symbol file: {{.*}}/bin-split-stripped
2323
# CHECK-NEXT: Type: "dwo"
2424
# CHECK-NEXT: Dwo ID{{.*}}
25-
# CHECK: {{0x[0-9a-f]+.* +.*}}/output/bin-split-stripped.dwp(gen/bin-split.dwo){{ *$}}
25+
# CHECK-NEXT: {{[- ]+}}
26+
# Verify it found the DWP file properly
27+
# CHECK-NEXT: 0x{{[0-9a-f]+.* +}}/{{.*}}/bin-split-stripped.dwp({{.*}}bin-split.dwo){{ *$}}

0 commit comments

Comments
 (0)