This is an archive of the discontinued LLVM Phabricator instance.

Fix the handling of FPR offsets in Linux arm/aarch64 register contexts
ClosedPublic

Authored by tberghammer on Sep 4 2015, 8:42 AM.

Details

Summary

Fix the handling of FPR offsets in Linux arm/aarch64 register contexts

This should fix the expression evaluation on the Android-aarch64 build bot, but I haven't managed to reproduce the issue locally

Diff Detail

Repository
rL LLVM

Event Timeline

tberghammer updated this revision to Diff 34034.Sep 4 2015, 8:42 AM
tberghammer retitled this revision from to Fix the handling of FPR offsets in Linux arm/aarch64 register contexts.
tberghammer updated this object.
tberghammer added reviewers: labath, chaoren, omjavaid.
tberghammer added a subscriber: lldb-commits.
labath accepted this revision.Sep 4 2015, 9:56 AM
labath edited edge metadata.

I would rather see the register variables laid out in a way which makes the offsets meaningful. I.e., instead of having m_fpr, m_gpr, ... we put something like

struct Regs {
  uint32_t gpr[...];
  FPU fpu;
  DREG hbr_regs;
  ...
};
Regs m_registers;

Then the byte offset field in Register Info structure will truly correspond to the offset in this structure, and we can index it simply with:

assert(offset < sizeof m_register);
address =  (char *)&m_registers + offset;

But if you want to keep this change small then it's ok for now.

This revision is now accepted and ready to land.Sep 4 2015, 9:56 AM

I prefer to keep it this way because there is no canonical register layout we can rely on so putting them just next to each other would be just an arbitrary layout what might break in the future. If we want the offsets to make sense, then on arm/aarch64 the best approach would be to store the offset from the beginning of the given register set because it will make sense on its own and with the data returned by ptrace.

This revision was automatically updated to reflect the committed changes.