This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Fix SVE reginfo for sequential offset in g packet
ClosedPublic

Authored by omjavaid on Nov 3 2020, 11:50 PM.

Details

Summary

This moves in the direction of our effort to synchronize register descriptions between LLDB and GDB xml description. We want to able to send registers in a way that their offset fields can be re-constructed based on register sizes in the increasing order of register number.

In context to Arm64 SVE, FPCR and FPSR are same registers in FPU regset and SVE regset. Previously FPSR/FPCR offset was set at the end of SVE data because Linux ptrace data placed FPCR and FPSR at the end of SVE register set.

Now we have two options

  1. to include 2 additional primary FPCR/FPSR at the end of SVE regset and make existing FPCR/FPSR in FPU regset as their value regs.
  2. use the same register for both SVE and FPU register set.

I have taken the second choice and considering interoperability with other stubs like QEMU and that g packets should generate register data in increasing order of register numbers. We have to move FPCR/FPSR offset up to its original location according to register numbering scheme of ARM64 registers with SVE registers included.

Diff Detail

Event Timeline

omjavaid created this revision.Nov 3 2020, 11:50 PM
omjavaid requested review of this revision.Nov 3 2020, 11:50 PM
labath accepted this revision.Nov 4 2020, 2:07 AM

The fact that the byte_offset field doubles as a g offset and a ptrace offset is makes things pretty convoluted. Maybe (just maybe) one day we wouldn't even need to materialize the g offset anywhere -- it could just be computed on-the-fly when iterating through the g and qRegisterInfo packets.

This revision is now accepted and ready to land.Nov 4 2020, 2:07 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 4:18 AM