Commit 4e4763a
authored
[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:fd266c131 parent 4977444 commit 4e4763a
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 | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| |||
1054 | 1054 | | |
1055 | 1055 | | |
1056 | 1056 | | |
1057 | | - | |
1058 | | - | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
1059 | 1060 | | |
1060 | 1061 | | |
1061 | 1062 | | |
1062 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1063 | 1070 | | |
1064 | 1071 | | |
1065 | 1072 | | |
| |||
1070 | 1077 | | |
1071 | 1078 | | |
1072 | 1079 | | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1073 | 1088 | | |
0 commit comments