xref: /llvm-project/lldb/test/Shell/SymbolFile/Breakpad/inline-record.test (revision f5ba0a3d059380c62dd06cc8091e6aee53f3401f)
1# RUN: yaml2obj %S/Inputs/basic-elf.yaml -o %T/inline-record.out
2# RUN: %lldb %T/inline-record.out -o "target symbols add -s inline-record.out %S/Inputs/inline-record.syms" \
3# RUN:   -s %s | FileCheck --match-full-lines %s
4
5# CHECK-LABEL: (lldb) image lookup -a 0x400010 -v
6# CHECK:       Summary: inline-record.out`f1 [inlined] inlined_f1 at a.c:3
7# CHECK-NEXT:           inline-record.out`f1 at a.c:8
8# CHECK:      Function: id = {{.*}}, name = "f1", range = [0x0000000000400010-0x0000000000400020)
9# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400010-0x00400020)
10# CHECK-NEXT:           id = {{.*}}, ranges = [0x00400010-0x00400015)[0x00400017-0x0040001b), name = "inlined_f1"
11
12# CHECK-LABEL: (lldb) image lookup -a 0x400016 -v
13# CHECK:       Summary: inline-record.out`f1 + 6 at a.c:3
14# CHECK-NOT:            inline-record.out`f1
15# CHECK:      Function: id = {{.*}}, name = "f1", range = [0x0000000000400010-0x0000000000400020)
16# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400010-0x00400020)
17
18# CHECK-LABEL: (lldb) image lookup -a 0x400023 -v
19# CHECK:      Summary: inline-record.out`f2 + 3 [inlined] inlined_f2 at b.c:2
20# CHECK-NEXT:          inline-record.out`f2 + 3 [inlined] inlined_f1 at b.c:4
21# CHECK-NEXT:          inline-record.out`f2 + 3 at a.c:3
22# CHECK:      Function: id = {{.*}}, name = "f2", range = [0x0000000000400020-0x0000000000400030)
23# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400020-0x00400030)
24# CHECK-NEXT:           id = {{.*}}, range = [0x00400023-0x0040002d), name = "inlined_f1"
25# CHECK-NEXT:           id = {{.*}}, range = [0x00400023-0x00400028), name = "inlined_f2"
26
27# CHECK-LABEL: (lldb) image lookup -a 0x400029 -v
28# CHECK:      Summary: inline-record.out`f2 + 9 [inlined] inlined_f1 + 6 at b.c:2
29# CHECK-NEXT:          inline-record.out`f2 + 3 at a.c:3
30# CHECK:      Function: id = {{.*}}, name = "f2", range = [0x0000000000400020-0x0000000000400030)
31# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400020-0x00400030)
32# CHECK-NEXT:           id = {{.*}}, range = [0x00400023-0x0040002d), name = "inlined_f1"
33
34# CHECK-LABEL: (lldb) image lookup -a 0x400030 -v
35# CHECK:       Summary: inline-record.out`f3 [inlined] inlined_f1 at b.c:3
36# CHECK-NEXT:           inline-record.out`f3 at 3
37# CHECK:      Function: id = {{.*}}, name = "f3", range = [0x0000000000400030-0x0000000000400040)
38# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400030-0x00400040)
39# CHECK-NEXT:           id = {{.*}}, range = [0x00400030-0x00400035), name = "inlined_f1"
40
41
42# CHECK-LABEL: (lldb) image lookup -a 0x400035 -v
43# CHECK:      Summary: inline-record.out`f3 + 5 [inlined]  at b.c:3
44# CHECK-NEXT:          inline-record.out`f3 + 5 at a.c:3
45# CHECK:      Function: id = {{.*}}, name = "f3", range = [0x0000000000400030-0x0000000000400040)
46# CHECK-NEXT:   Blocks: id = {{.*}}, range = [0x00400030-0x00400040)
47# CHECK-NEXT:           id = {{.*}}, range = [0x00400035-0x0040003a)
48
49image lookup -a 0x400010 -v
50image lookup -a 0x400016 -v
51image lookup -a 0x400023 -v
52image lookup -a 0x400029 -v
53# Folling addresses are inside INLINE records that have file index or origin index out of range.
54image lookup -a 0x400030 -v
55image lookup -a 0x400035 -v
56exit
57