59 lines · plain
1# REQUIRES: x862 3# RUN: yaml2obj %S/Inputs/unwind-via-stack-win.yaml -o %t4# RUN: %lldb -c %t \5# RUN: -o "target symbols add %S/Inputs/unwind-via-stack-win.syms" \6# RUN: -s %s -b | FileCheck %s7 8# First check that unwind plan generation works correctly.9# This function has a "typical" unwind rule.10image show-unwind -n call_many11# CHECK-LABEL: image show-unwind -n call_many12# CHECK: UNWIND PLANS for unwind-via-stack-win.exe`call_many13# CHECK: Symbol file UnwindPlan:14# CHECK: This UnwindPlan originally sourced from breakpad STACK WIN15# CHECK: This UnwindPlan is sourced from the compiler: yes.16# CHECK: This UnwindPlan is valid at all instruction locations: no.17# CHECK: This UnwindPlan is for a trap handler function: no.18# CHECK: Address range of this UnwindPlan: [unwind-via-stack-win.exe..module_image + 4112-4221)19# CHECK: row[0]: 0: CFA=DW_OP_breg7 +0, DW_OP_consts +80, DW_OP_plus => esp=DW_OP_pick 0x0, DW_OP_consts +4, DW_OP_plus eip=DW_OP_pick 0x0, DW_OP_deref20 21# Then, some invalid rules.22image show-unwind -n bogus_rule23# CHECK-LABEL: image show-unwind -n bogus_rule24# CHECK: UNWIND PLANS for unwind-via-stack-win.exe`bogus_rule25# CHECK-NOT: Symbol file26 27image show-unwind -n bogus_cfa_rhs28# CHECK-LABEL: image show-unwind -n bogus_cfa_rhs29# CHECK: UNWIND PLANS for unwind-via-stack-win.exe`bogus_cfa_rhs30# CHECK-NOT: Symbol file31 32image show-unwind -n bogus_esp_rhs33# CHECK-LABEL: image show-unwind -n bogus_esp_rhs34# CHECK: UNWIND PLANS for unwind-via-stack-win.exe`bogus_esp_rhs35# CHECK-NOT: Symbol file36 37# We don't treat unknown lhs as an error, as it can be just a temporary38# variable used in other rules.39image show-unwind -n temporary_var40# CHECK-LABEL: image show-unwind -n temporary_var41# CHECK: UNWIND PLANS for unwind-via-stack-win.exe`temporary_var42# CHECK: Symbol file UnwindPlan:43# CHECK: This UnwindPlan originally sourced from breakpad STACK WIN44# CHECK: This UnwindPlan is sourced from the compiler: yes.45# CHECK: This UnwindPlan is valid at all instruction locations: no.46# CHECK: This UnwindPlan is for a trap handler function: no.47# CHECK: Address range of this UnwindPlan: [unwind-via-stack-win.exe..module_image + 4400-4404)48# CHECK: row[0]: 0: CFA=DW_OP_breg7 +0 => esp=DW_OP_pick 0x0, DW_OP_consts +4, DW_OP_plus eip=DW_OP_pick 0x0, DW_OP_deref49 50# And finally, check that backtracing works as a whole by unwinding a simple51# stack.52thread backtrace53# CHECK-LABEL: thread backtrace54# CHECK: frame #0: 0x000b1092 unwind-via-stack-win.exe`many_pointer_args55# CHECK: frame #1: 0x000b1079 unwind-via-stack-win.exe`call_many + 10556# CHECK: frame #2: 0x000b1085 unwind-via-stack-win.exe`main + 557# CHECK: frame #3: 0x77278494 kernel32.dll58# CHECK-NOT: frame59