This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Use r11 as frame pointer on Windows on ARM
ClosedPublic

Authored by mstorsjo on Nov 27 2019, 2:23 PM.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 27 2019, 2:23 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 27 2019, 2:23 PM

Presumably, this should change how unwind plans are computed. The unwind machinery will treat a mov %sp, %fp(whatever is the arm equivalent) as a signal that it should switch to an frame-pointer based unwind. This logic should not kick in if lldb does not think this register is the frame pointer register. You should be able to check this via image show-unwind. If that shows some difference then it should be possible to concoct a function where the unwind goes wrong because of this, but that's not necessary -- it should be enough to just check that a reasonable unwind plan is generated.

mstorsjo updated this revision to Diff 231416.Nov 28 2019, 5:41 AM
mstorsjo edited the summary of this revision. (Show Details)

Added a testcase using a minidump. I had to add recognition of r11 as a potential frame pointer register in thumb mode in the handling of one instruction, to make it pick up the exact form my testcase happened to use. There's potentially other cases also where the thumb emulation doesn't expect r11 to be a frame pointer, but this at least verifies the change to GetFramePointerRegisterNumber.

labath accepted this revision.Nov 29 2019, 1:50 AM
This revision is now accepted and ready to land.Nov 29 2019, 1:50 AM
This revision was automatically updated to reflect the committed changes.