Page MenuHomePhabricator

Stack unwinding emulation: handle adjustment of FP
ClosedPublic

Authored by tberghammer on Feb 16 2016, 9:50 AM.

Details

Summary

Stack unwinding emulation: handle adjustment of FP

This change is improving the instruction emulation based unwinding to
handle when the frame pointer is adjusted (increment/decrement) after
it has been initialized. The situation can occur in the prologue of
some function where FP is adjusted before it is copied back to SP.

Example code (thumb, generated by gcc 4.8):
< +0>: push {r4, r7, lr}
< +2>: sub sp, #0x14
< +4>: add r7, sp, #0x0
...
<+50>: adds r7, #0x14 ; The CL fixes the handling of this instruction
<+52>: mov sp, r7 ; Previously unwinding from here was broken
<+54>: pop {r4, r7, pc}

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer retitled this revision from to Stack unwinding emulation: handle adjustment of FP.
tberghammer updated this object.
tberghammer added a subscriber: lldb-commits.
ovyalov accepted this revision.Feb 16 2016, 2:09 PM
ovyalov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 16 2016, 2:09 PM
clayborg accepted this revision.Feb 18 2016, 4:39 PM
clayborg edited edge metadata.

Looks good to me.

This revision was automatically updated to reflect the committed changes.