Skip to content

Commit 6c3ee2a

Browse files
author
Kevin Frei
committed
One failling test that looks like a real bug...for tomorrow
1 parent e676f08 commit 6c3ee2a

23 files changed

+339
-183
lines changed

lldb/test/Shell/Debuginfod/okd-split-negative.test

Lines changed: 0 additions & 31 deletions
This file was deleted.

lldb/test/Shell/Debuginfod/okd-split-positive.test

Lines changed: 0 additions & 40 deletions
This file was deleted.

lldb/test/Shell/Debuginfod/okd-stripped-negative.test

Lines changed: 0 additions & 32 deletions
This file was deleted.

lldb/test/Shell/Debuginfod/okd-stripped-positive.test

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
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
19+
20+
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
21+
# RUN: -o "target create %t/output/bin-stripped" \
22+
# RUN: -o "b func" \
23+
# RUN: -o "quit" \
24+
# RUN: 2>&1 | FileCheck %s
25+
26+
# Should NOT have source file information:
27+
28+
# CHECK: Breakpoint 1: where = bin-stripped`func, address = 0x{{[0-9a-f]+}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
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
17+
18+
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
19+
# RUN: -o "target create %t/output/bin-stripped" \
20+
# RUN: -o "b func" \
21+
# RUN: -o "quit" \
22+
# RUN: 2>&1 | FileCheck %s
23+
24+
# Should have source file information:
25+
26+
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
# RUN: mkdir -p %t/cache
7+
# RUN: mkdir -p %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d
8+
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
21+
22+
# RUN: %lldb -o "settings set symbols.enable-external-lookup true" \
23+
# RUN: -o "settings set plugin.symbol-locator.debuginfod.cache-path %t/cache" \
24+
# RUN: -o "settings clear plugin.symbol-locator.debuginfod.server-urls" \
25+
# RUN: -o "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%t" \
26+
# RUN: -o "target create %t/output/bin-stripped" \
27+
# RUN: -o "b func" \
28+
# RUN: -o "quit" \
29+
# RUN: 2>&1 | FileCheck %s
30+
31+
# Should have source file information:
32+
33+
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
# RUN: mkdir -p %t/cache
7+
# RUN: mkdir -p %t/buildid/725d47b7ee964f615c841a04712d6f43175f9d8d
8+
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
21+
22+
# RUN: %lldb -o "settings set symbols.enable-external-lookup true" \
23+
# RUN: -o "settings set plugin.symbol-locator.debuginfod.cache-path %t/cache" \
24+
# RUN: -o "settings clear plugin.symbol-locator.debuginfod.server-urls" \
25+
# RUN: -o "settings insert-before plugin.symbol-locator.debuginfod.server-urls 0 file://%t" \
26+
# RUN: -o "target create %t/output/bin-stripped" \
27+
# RUN: -o "b func" \
28+
# RUN: -o "quit" \
29+
# RUN: 2>&1 | FileCheck %s
30+
31+
# Should have source file information:
32+
33+
# CHECK: Breakpoint 1: where = bin-stripped`func + 11 at main.c:69:11, address = 0x{{[0-9a-f]+}}

lldb/test/Shell/Debuginfod/simple-dwp-negative.test

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
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)
14+
15+
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
16+
# RUN: -o "target create %t/output/bin-split" \
17+
# RUN: -o "target modules dump separate-debug-info" \
18+
# RUN: -o "quit" \
19+
# RUN: 2>&1 | FileCheck %s
20+
21+
# CHECK: Symbol file: {{.*}}/bin-split
22+
# CHECK-NEXT: Type: "dwo"
23+
# CHECK-NEXT: Dwo ID{{.*}}
24+
# CHECK-NEXT: {{^[- ]+$}}
25+
# CHECK-NEXT: 0x{{[0-9a-f]+.*}} unable to locate .dwo debug file {{.*}}bin-split.dwo{{.*}} for skeleton DIE 0x{{[0-9a-f]+}}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
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
9+
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
16+
17+
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
18+
# RUN: -o "target create %t/output/bin-split" \
19+
# RUN: -o "target modules dump separate-debug-info" \
20+
# RUN: -o "quit" \
21+
# RUN: 2>&1 | FileCheck %s
22+
23+
# CHECK: Symbol file: {{.*}}/bin-split
24+
# CHECK-NEXT: Type: "dwo"
25+
# CHECK-NEXT: Dwo ID{{.*}}
26+
# CHECK-NEXT: {{^[- ]+$}}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# REQUIRES: system-linux && native && target-x86_64
2+
3+
# We set up a file-system 'hosted' Debuginfod server
4+
5+
# RUN: mkdir -p %t/output
6+
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
15+
16+
# RUN: %lldb -o "settings set symbols.enable-external-lookup false" \
17+
# RUN: -o "target create %t/output/bin-split-stripped" \
18+
# RUN: -o "target modules dump separate-debug-info" \
19+
# RUN: -o "quit" \
20+
# RUN: 2>&1 | FileCheck %s
21+
22+
# CHECK: Current executable set to {{.*}}.tmp/output/bin-split-stripped' (x86_64).
23+
# CHECK-NEXT: target modules dump separate-debug-info
24+
# CHECK-NEXT: error: no matching executable images found

0 commit comments

Comments
 (0)