This is an archive of the discontinued LLVM Phabricator instance.

Add support to detect arm hard float ABI based binaries for ABISysV_arm
ClosedPublic

Authored by omjavaid on Jan 27 2016, 6:08 AM.

Details

Summary

This patch adds logic to detect if underlying binary is using arm hard float abi and use that information while handling return values in ABISysV_arm.

This patch only handles float and double passed using floating point registers.

More return types and argument passing will be handled in a follow up patches.

Diff Detail

Repository
rL LLVM

Event Timeline

omjavaid updated this revision to Diff 46126.Jan 27 2016, 6:08 AM
omjavaid retitled this revision from to Add support to detect arm hard float ABI based binaries for ABISysV_arm.
omjavaid updated this object.
omjavaid added reviewers: tberghammer, clayborg.
omjavaid added a subscriber: lldb-commits.
tberghammer accepted this revision.Jan 27 2016, 7:24 AM
tberghammer edited edge metadata.

Looks good with a few nits inline

source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
418 ↗(On Diff #46126)

(nit): I would suggest to pass in the thread by reference because the function have no meaning with a NULL thread

427 ↗(On Diff #46126)

This will break if we add a new (independent) architecture flag for arm in the future. Please only check if the given bit is set instead of comparing for equality.

427–430 ↗(On Diff #46126)

(nit): You can write it much simpler like this:

return (arch.GetFlags() & ArchSpec::eARM_abi_hard_float) != 0;
539 ↗(On Diff #46126)

(nit); Please revert the order of the if and the else case so you don't have to negate the condition

This revision is now accepted and ready to land.Jan 27 2016, 7:24 AM
clayborg requested changes to this revision.Jan 27 2016, 9:51 AM
clayborg edited edge metadata.

Change over to use a "Thread &" as argument to "bool ABISysV_arm::IsArmHardFloat(Thread *)" and this is good to go.

This revision now requires changes to proceed.Jan 27 2016, 9:51 AM

And fix all of the tberghammer's comments as well.

omjavaid updated this revision to Diff 46620.Feb 1 2016, 11:58 PM
omjavaid edited edge metadata.
omjavaid marked 4 inline comments as done.

Updated after addressing concerns.

LGTM?

tberghammer accepted this revision.Feb 2 2016, 5:11 AM
tberghammer edited edge metadata.

Looks good

clayborg accepted this revision.Feb 2 2016, 9:30 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Feb 2 2016, 9:30 AM
This revision was automatically updated to reflect the committed changes.