llvm-project/lldb/test/Shell/Unwind/basic-block-sections-with-dwarf.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

24 lines
778 B
Plaintext

# Test that lldb is able to unwind out of a function which is in between two
# parts of a split function. This tests a specific bug where lldb would not find
# unwind info for the "inner" function if it encountered if after the split
# function. The presence of debug info is important for this test.
# REQUIRES: system-linux, native
# REQUIRES: target-x86_64
# RUN: %clang_host %S/Inputs/basic-block-sections-with-dwarf.s -o %t
# RUN: %lldb %t -s %s -o exit | FileCheck %s
breakpoint set -n baz
# CHECK: Breakpoint 1: where = {{.*}}`baz
process launch
# CHECK: stop reason = breakpoint 1
thread backtrace
# CHECK: frame #0: {{.*}}`baz
# CHECK: frame #1: {{.*}}`foo(flag=0)
# CHECK: frame #2: {{.*}}`bar
# CHECK: frame #3: {{.*}}`foo(flag=1)
# CHECK: frame #4: {{.*}}`main