This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [Process/NetBSD] Add register info for missing register sets
ClosedPublic

Authored by mgorny on Oct 31 2019, 9:19 AM.

Details

Summary

Add info for all register sets supported in NetBSD, particularly for all
registers 'expected' by LLDB. This is necessary in order to fix
python_api/lldbutil/iter/TestRegistersIterator.py test that currently
fails due to missing names of register sets (None).

This copies fpreg descriptions from Linux, and combines Linux' AVX
and MPX registers into a single XState group, to fit NetBSD register
group design. Technically, we do not support MPX registers
at the moment but gdb-remote insists on passing their errors anyway,
and if we do not include it in any group, they end up in a separate
anonymous group that breaks the test.

While at it, swap the enums for XState and DBRegs to match register set
ordering.

This also adds a few consts to the lldb-x86-register-enums.h to provide
more consistency between user registers and debug registers.

Diff Detail

Event Timeline

mgorny created this revision.Oct 31 2019, 9:19 AM
mgorny updated this revision to Diff 227545.Nov 1 2019, 3:19 PM

Include reenabling fixed test.

labath accepted this revision.Nov 4 2019, 9:20 AM

This seems reasonable to me. I take it there is already some logic which will make the MPX registers not show up when the machine does not support them (i.e., never on netbsd)?

This revision is now accepted and ready to land.Nov 4 2019, 9:20 AM

I take it there is already some logic which will make the MPX registers not show up when the machine does not support them (i.e., never on netbsd)?

To be honest, I don't think so. I know that we return Error:

error.SetErrorStringWithFormat("register \"%s\" is in unrecognized set",
                               reg_info->name);

This was designed before me.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2019, 10:38 AM