This is an archive of the discontinued LLVM Phabricator instance.

Fix for undefined behavior while updating PC value on arm-linux
ClosedPublic

Authored by omjavaid on Jan 4 2016, 4:37 PM.

Details

Summary

This patch provides fix for the cases where an expression or jump tries to update the value of PC in thumb mode.

As precaution for an undefined behavior encountered while setting PC we will clear thumb bit of new PC if we are already in thumb mode; that is CPSR thumb mode bit is set.

Also if intended behavior of setting new PC value is to change to ARM/Thumb mode then user must switch to arm or thumb mode by explicitly setting mode bit in CPSR. This update to CPSR should be done before writing new PC value.

Diff Detail

Repository
rL LLVM

Event Timeline

omjavaid updated this revision to Diff 43941.Jan 4 2016, 4:37 PM
omjavaid retitled this revision from to Fix for undefined behavior while updating PC value on arm-linux.
omjavaid updated this object.
omjavaid added reviewers: tberghammer, clayborg.
omjavaid added a subscriber: lldb-commits.
clayborg accepted this revision.Jan 4 2016, 4:45 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Jan 4 2016, 4:45 PM
tberghammer accepted this revision.Jan 5 2016, 2:38 AM
tberghammer edited edge metadata.

Looks good but please fix the indentation to match with the LLDB style (4 space)

This revision was automatically updated to reflect the committed changes.