This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [gdb-remote] Fix displaying i387_ext & vec regs with gdbserver
ClosedPublic

Authored by mgorny on Aug 20 2021, 9:03 AM.

Details

Summary

Adjust the encoding and format applied to i387_ext and vec* type
registers from gdbserver to match lldb-server. Both types are now
displayed as vector of uint8 instead of float and integer formats used
before. Additionally, this fixes display of STi registers when they do
not carry floating-point data (they are also used to hold MMX vectors).

Add client tests using GDB-style target.xml.

Diff Detail

Event Timeline

mgorny requested review of this revision.Aug 20 2021, 9:03 AM
mgorny created this revision.
mgorny updated this revision to Diff 369415.Aug 30 2021, 4:38 AM

Correct the test case to actually include data for all XMM registers (NFC).

mgorny updated this revision to Diff 369419.Aug 30 2021, 5:09 AM

Actually, the test should include 16 XMM registers and MXCSR.

labath added a comment.Sep 8 2021, 5:50 AM

Is printing STi as a vector actually desired? It seems to me that printing them as floating point would be more useful. Have you looked at what it would take to make lldb-server print them as FP as well?

mgorny added a comment.Sep 8 2021, 6:47 AM

At a quick glance, we'd have to enhance Scalar to fully support x87 extended type. FWICS it's currently modeled to use convert APFloat from/to float/double/long double types. Maybe we could get away with some lossy rounding but it doesn't like a good way forward. It would probably be a better idea to drop some of the abstraction and/or use APFloat more.

I don't think an effort to getting proper x87 float support should be blocking this. If anyone is sufficiently motivated to implement it, it will be easy to switch the client to it, both for lldb-server and gdbserver usage.

labath accepted this revision.Oct 12 2021, 3:40 AM
This revision is now accepted and ready to land.Oct 12 2021, 3:40 AM
This revision was landed with ongoing or failed builds.Oct 12 2021, 6:16 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2021, 6:16 AM