aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/Shell/Unwind/basic-block-sections-with-dwarf-static.test
blob: b926432c31196fff58468087faff956323f9b55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Test unwind info for functions which have been split into two or more parts.
# In particular, check we return the correct set of unwind plans when querying
# addresses which are in the middle of discontinuous functions.

# REQUIRES: lld, target-x86_64

# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj \
# RUN:   %S/Inputs/basic-block-sections-with-dwarf.s > %t.o
# RUN: ld.lld %t.o -o %t
## NB: This minidump exists only as a receptacle for the object file built
## above. This is a workaround for the fact that "image show-unwind" does not
## work without a Process object.
# RUN: yaml2obj %S/Inputs/linux-x86_64.yaml > %t.core
# RUN: %lldb -c %t.core %t -o "image load --file %t --slide 0" -s %s -o exit | \
# RUN:   FileCheck --implicit-check-not="UNWIND PLANS" %s

image show-unwind --cached true -n foo
# CHECK: UNWIND PLANS for {{.*}}`foo
#
# CHECK:      eh_frame UnwindPlan:
# CHECK-NEXT: This UnwindPlan originally sourced from eh_frame CFI
# CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.
# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: no.
# CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 6-11)[{{.*}}.text + 12-27)[{{.*}}.text + 43-57)[{{.*}}.text + 58-69)
# CHECK-NEXT: row[0]:  -37: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[1]:  -33: CFA=rsp +8 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[2]:  -31: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[3]:  -27: CFA=rsp+48 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[4]:  -18: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[5]:    0: CFA=rsp +8 => rip=[CFA-8]
# CHECK-NEXT: row[6]:    1: CFA=rsp+16 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[7]:   12: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[8]:   15: CFA=rsp+16 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-NEXT: row[9]:   19: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
# CHECK-EMPTY:

image show-unwind --cached true -n bar
# CHECK: UNWIND PLANS for {{.*}}`bar

# CHECK:      eh_frame UnwindPlan:
# CHECK-NEXT: This UnwindPlan originally sourced from eh_frame CFI
# CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.
# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: no.
# CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 27-43)
# CHECK-NEXT: row[0]:    0: CFA=rsp +8 => rip=[CFA-8]
# CHECK-NEXT: row[1]:    4: CFA=rsp+96 => rip=[CFA-8]
# CHECK-NEXT: row[2]:   15: CFA=rsp +8 => rip=[CFA-8]
# CHECK-EMPTY: