summaryrefslogtreecommitdiffstats
path: root/lldb/unittests/Target/ModuleCacheTest.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2017-06-29 12:40:13 +0000
committerPavel Labath <labath@google.com>2017-06-29 12:40:13 +0000
commit8996346bbae8e0cbc97cb5c8c99c49dd7f9f75fa (patch)
tree14b6c4921740c91cbcd4bf6b7323df8912242411 /lldb/unittests/Target/ModuleCacheTest.cpp
parent0cddd34876d210536fe1656c02a0e9b7c83719bf (diff)
downloadbcm5719-llvm-8996346bbae8e0cbc97cb5c8c99c49dd7f9f75fa.tar.gz
bcm5719-llvm-8996346bbae8e0cbc97cb5c8c99c49dd7f9f75fa.zip
[UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern
Summary: The instruction pattern: and $-16, %esp sub $imm, %esp ... lea imm(%ebp), %esp appears when the compiler is realigning the stack (for example in main(), or almost everywhere with -mstackrealign switch). The "and" instruction is very difficult to model, but that's not necessary, as these frames are always %ebp-based (the compiler also needs a way to restore the original %esp). Therefore the plans we were generating for these function were almost correct already. The only place we were doing it wrong were the last instructions of the epilogue (usually just "ret"), where we had to revert to %esp-based unwinding, as the %ebp had been popped already. This was wrong because our "distance of esp from cfa" counter had picked up the "sub" instruction (and incremented the counter) but it had not seen that the register was reset by the "lea" instruction. This patch fixes that shortcoming, and adds a test for handling functions like this. I have not been able to tickle the compiler into producing a 64-bit function with this pattern, but I don't see a reason why it couldn't produce it, if it chose to, so I add a x86_64 test as well. Reviewers: jasonmolenda, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34750 llvm-svn: 306666
Diffstat (limited to 'lldb/unittests/Target/ModuleCacheTest.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud