Commit 80a6823
committed
[lldb] Handle backwards branches in UnwindAssemblyInstEmulation (llvm#169633)
This allows the unwinder to handle code with mid-function epilogues
where the subsequent code is reachable through a backwards branch.
Two changes are required to accomplish this:
1. Do not enqueue the subsequent instruction if the current instruction
is a barrier(*).
2. When processing an instruction, stop ignoring branches with negative
offsets.
(*) As per the definition in LLVM's MC layer, a barrier is any
instruction that "stops control flow from executing the instruction
immediately following it". See `MCInstrDesc::isBarrier` in MCInstrDesc.h
Part of a sequence of PRs:
[lldb][NFCI] Rewrite UnwindAssemblyInstEmulation in terms of a CFG visit
llvm#169630
[lldb][NFC] Rename forward_branch_offset to branch_offset in
UnwindAssemblyInstEmulation llvm#169631
[lldb] Add DisassemblerLLVMC::IsBarrier API llvm#169632
[lldb] Handle backwards branches in UnwindAssemblyInstEmulation llvm#169633
commit-id:fd266c13
(cherry picked from commit 4e4763a)1 parent dba9d76 commit 80a6823
File tree
3 files changed
+28
-9
lines changed- lldb
- source/Plugins/UnwindAssembly/InstEmulation
- unittests/UnwindAssembly/ARM64
3 files changed
+28
-9
lines changedLines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
230 | 234 | | |
231 | 235 | | |
232 | 236 | | |
| |||
530 | 534 | | |
531 | 535 | | |
532 | 536 | | |
533 | | - | |
| 537 | + | |
534 | 538 | | |
535 | 539 | | |
536 | 540 | | |
537 | | - | |
| 541 | + | |
538 | 542 | | |
539 | 543 | | |
540 | 544 | | |
541 | | - | |
| 545 | + | |
542 | 546 | | |
543 | 547 | | |
544 | 548 | | |
545 | | - | |
| 549 | + | |
546 | 550 | | |
547 | 551 | | |
548 | 552 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
879 | 879 | | |
880 | 880 | | |
881 | 881 | | |
882 | | - | |
| 882 | + | |
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
| |||
946 | 946 | | |
947 | 947 | | |
948 | 948 | | |
949 | | - | |
950 | | - | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
951 | 952 | | |
952 | 953 | | |
953 | 954 | | |
954 | | - | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
955 | 962 | | |
956 | 963 | | |
957 | 964 | | |
| |||
962 | 969 | | |
963 | 970 | | |
964 | 971 | | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
965 | 980 | | |
0 commit comments