Files
clang-p2996/lldb/test/Shell/Unwind/basic-block-sections-with-dwarf-static.test
Pavel Labath 17aca79d98 [lldb] Teach FuncUnwinders about discontinuous functions (#133072)
The main change here is that we're now able to correctly look up plans
for these functions. Previously, due to caching, we could end up with
one entry covering most of the address space (because part of the
function was at the beginning and one at the end). Now, we can correctly
recognise that the part in between does not belong to that function, and
we can create a different FuncUnwinders instance for it. It doesn't help
the discontinuous function much (its plan will still be garbled), but
we can at least properly unwind out of the simple functions in between.

Fixing the unwind plans for discontinuous functions requires handling
each unwind source specially, and this setup allows us to make the
transition incrementally.
2025-03-27 12:51:20 +01:00

40 lines
2.0 KiB
Plaintext

# 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: Assembly language inspection UnwindPlan:
# CHECK-NEXT: This UnwindPlan originally sourced from assembly insn profiling
# CHECK-NEXT: This UnwindPlan is sourced from the compiler: no.
# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: yes.
# CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
# TODO: This address range isn't correct right now. We're just checking that
# it's a different range from the one in the next query.
# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 6-0x0000000000000046)
image show-unwind --cached true -n bar
# CHECK: UNWIND PLANS for {{.*}}`bar
# CHECK: Assembly language inspection UnwindPlan:
# CHECK-NEXT: This UnwindPlan originally sourced from assembly insn profiling
# CHECK-NEXT: This UnwindPlan is sourced from the compiler: no.
# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: yes.
# CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
# TODO: This address range isn't correct right now. We're just checking that
# it's a different range from the one in the previous query.
# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 35-0x0000000000000033)