|
1 |
| -# TODO: When it's possible to run "image show-unwind" without a running |
2 |
| -# process, we can remove the unsupported line below, and hard-code an ELF |
3 |
| -# triple in the test. |
4 |
| -# UNSUPPORTED: system-windows, system-darwin |
5 |
| - |
6 |
| -# RUN: cd %T |
7 |
| -# RUN: %clang_host %S/Inputs/target-symbols-add-unwind.c -g \ |
8 |
| -# RUN: -fno-unwind-tables -fno-asynchronous-unwind-tables \ |
9 |
| -# RUN: -o target-symbols-add-unwind.debug |
10 |
| -# RUN: llvm-objcopy --strip-debug target-symbols-add-unwind.debug \ |
11 |
| -# RUN: target-symbols-add-unwind.stripped |
12 |
| -# RUN: %lldb target-symbols-add-unwind.stripped -s %s -o quit | FileCheck %s |
13 |
| - |
14 |
| -process launch --stop-at-entry |
15 |
| -image show-unwind -n main |
16 |
| -# CHECK-LABEL: image show-unwind -n main |
| 1 | +# NB: The minidump core file exists only because "image show-unwind" currently |
| 2 | +# requires a process to exist. If that changes, it can be removed. |
| 3 | + |
| 4 | +# REQUIRES: x86, lld |
| 5 | + |
| 6 | +# RUN: split-file %s %t |
| 7 | +# RUN: yaml2obj %t/a.core.yaml -o %t/a.core |
| 8 | +# RUN: %clang -c --target=x86_64-pc-linux %t/a.s -o %t/a.o |
| 9 | +# RUN: ld.lld --shared %t/a.o -o %t/a.debug --build-id=0xdeadbeef \ |
| 10 | +# RUN: --image-base=0x10000 |
| 11 | +# RUN: llvm-objcopy --strip-all %t/a.debug %t/a.stripped |
| 12 | +# RUN: cd %t |
| 13 | +# RUN: %lldb -c %t/a.core \ |
| 14 | +# RUN: -o "settings set interpreter.stop-command-source-on-error false" \ |
| 15 | +# RUN: -s %t/commands -o quit | FileCheck %s |
| 16 | + |
| 17 | +#--- commands |
| 18 | + |
| 19 | +image add a.stripped |
| 20 | +image load --file a.stripped --slide 0 |
| 21 | +image list |
| 22 | +# CHECK-LABEL: image list |
| 23 | +# CHECK: [ 0] DEADBEEF 0x0000000000010000 a.stripped |
| 24 | + |
| 25 | +## Due to missing symbol information this (incorrectly) prints the unwind |
| 26 | +## information for public_fn1 |
| 27 | +image show-unwind -n public_fn1 --cached true |
| 28 | +# CHECK-LABEL: image show-unwind -n public_fn1 |
| 29 | +# CHECK-NEXT: UNWIND PLANS for a.stripped`public_fn1 (start addr 0x12000) |
17 | 30 | # CHECK-NOT: debug_frame UnwindPlan:
|
18 | 31 |
|
19 |
| -target symbols add -s target-symbols-add-unwind.stripped target-symbols-add-unwind.debug |
| 32 | +target symbols add -s a.stripped a.debug |
20 | 33 | # CHECK-LABEL: target symbols add
|
21 | 34 | # CHECK: symbol file {{.*}} has been added to {{.*}}
|
22 | 35 |
|
23 |
| -image show-unwind -n main |
24 |
| -# CHECK-LABEL: image show-unwind -n main |
| 36 | +image show-unwind -n private_fn --cached true |
| 37 | +# CHECK-LABEL: image show-unwind -n private_fn |
| 38 | +# CHECK-NEXT: UNWIND PLANS for a.stripped`private_fn (start addr 0x12010) |
25 | 39 | # CHECK: debug_frame UnwindPlan:
|
26 | 40 | # CHECK-NEXT: This UnwindPlan originally sourced from DWARF CFI
|
27 | 41 | # CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.
|
| 42 | +# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: no. |
| 43 | +# CHECK-NEXT: This UnwindPlan is for a trap handler function: no. |
| 44 | +# CHECK-NEXT: Address range of this UnwindPlan: [a.stripped.PT_LOAD[1]..text + 16-0x0000000000000013) |
| 45 | + |
| 46 | + |
| 47 | +#--- a.s |
| 48 | + |
| 49 | + .text |
| 50 | + .cfi_sections .debug_frame |
| 51 | + .globl public_fn1, public_fn2 |
| 52 | + |
| 53 | + .p2align 12 |
| 54 | +public_fn1: |
| 55 | + .cfi_startproc |
| 56 | + pushq %rbp |
| 57 | + .cfi_def_cfa_offset 16 |
| 58 | + .cfi_offset %rbp, -16 |
| 59 | + popq %rbp |
| 60 | + .cfi_def_cfa %rsp, 8 |
| 61 | + retq |
| 62 | + .cfi_endproc |
| 63 | + |
| 64 | + .p2align 4 |
| 65 | +private_fn: |
| 66 | + .cfi_startproc |
| 67 | + pushq %rbp |
| 68 | + .cfi_def_cfa_offset 16 |
| 69 | + .cfi_offset %rbp, -16 |
| 70 | + popq %rbp |
| 71 | + .cfi_def_cfa %rsp, 8 |
| 72 | + retq |
| 73 | + .cfi_endproc |
| 74 | + |
| 75 | + .p2align 4 |
| 76 | +public_fn2: |
| 77 | + .cfi_startproc |
| 78 | + pushq %rbp |
| 79 | + .cfi_def_cfa_offset 16 |
| 80 | + .cfi_offset %rbp, -16 |
| 81 | + popq %rbp |
| 82 | + .cfi_def_cfa %rsp, 8 |
| 83 | + retq |
| 84 | + .cfi_endproc |
| 85 | + |
| 86 | +#--- a.core.yaml |
| 87 | +--- !minidump |
| 88 | +Streams: |
| 89 | + - Type: SystemInfo |
| 90 | + Processor Arch: AMD64 |
| 91 | + Platform ID: Linux |
| 92 | + CPU: |
| 93 | + Vendor ID: GenuineIntel |
| 94 | + Version Info: 0x00000000 |
| 95 | + Feature Info: 0x00000000 |
| 96 | + - Type: ThreadList |
| 97 | + Threads: |
| 98 | + - Thread Id: 0x000074F3 |
| 99 | + Context: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B001000000000006CAE000000006B7FC05A0000C81D415A0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000A2BF9E5A6B7F0000000000000000000000000000000000008850C14BFD7F00009850C14BFD7F00000100000000000000B04AC14BFD7F0000000000000000000060812D01000000000800000000000000B065E05A6B7F00008004400000000000E050C14BFD7F00000000000000000000000000000000000004400000000000007F03FFFF0000FFFFFFFFFFFF000000000000000000000000801F00006B7F00000400000000000000B84CC14BFD7F0000304D405A6B7F0000C84DC14BFD7F0000C0AA405A6B7F00004F033D0000000000B84DC14BFD7F0000E84DC14BFD7F0000000000000000000000000000000000000070E05A6B7F000078629E5A6B7F0000C81D415A6B7F0000804F9E5A6B7F00000000000001000000E603000001000000E093115A6B7F0000804EC14BFD7F0000584EC14BFD7F000099ADC05A6B7F00000100000000000000AAAAD77D0000000002000000000000000800000000000000B065E05A6B7F0000E6B7C05A6B7F0000010000006B7F0000884DC14BFD7F0000106F7C5A6B7F0000984EC14BFD7F0000488B7C5A6B7F0000C4A71CB90000000001000000000000000800000000000000B065E05A6B7F000048B6C05A6B7F0000702AE25A6B7F0000D84DC14BFD7F000030489E5A6B7F0000E84EC14BFD7F0000E05E9E5A6B7F00000991F0460000000001000000000000000800000000000000B065E05A6B7F000048B6C05A6B7F00000100000000000000284EC14BFD7F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
| 100 | + Stack: |
| 101 | + Start of Memory Range: 0x00007FFD4BC15080 |
| 102 | + Content: 30044000000000000000000000000000 |
| 103 | + - Type: MemoryList |
| 104 | + Memory Ranges: |
| 105 | + - Start of Memory Range: 0x00007FFD4BC15080 |
| 106 | + Content: 30044000000000000000000000000000 |
| 107 | +... |
0 commit comments