[lldb] Add RegisterFlags class
authorDavid Spickett <david.spickett@linaro.org>
Fri, 5 Aug 2022 14:40:31 +0000 (14:40 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Thu, 13 Apr 2023 10:54:52 +0000 (10:54 +0000)
commit6ea45e3007b8a489afa56af13a2b8bfcec201a93
tree38638d18fd63abe44422cc99c0cde42ba3149072
parent0bfbecf52e8fa04785cf0b5c38b25c13442fb53d
[lldb] Add RegisterFlags class

This models the "flags" node from GDB's target XML:
https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html

This node is used to describe the fields of registers like cpsr on AArch64.

RegisterFlags is a class that contains a list of register fields.
These fields will be extracted from the XML sent by the remote.

We assume that there is at least one field, that the fields are
sorted in descending order and do not overlap. That will be
enforced by the XML processor (the GDB client code in our case).

The fields may not cover the whole register. To account for this
RegisterFields will add anonymous padding fields so that
sizeof(all fields) == sizeof(register). This will save a lot
of hasssle later.

Reviewed By: jasonmolenda, JDevlieghere

Differential Revision: https://reviews.llvm.org/D145566
lldb/include/lldb/Target/RegisterFlags.h [new file with mode: 0644]
lldb/source/Target/CMakeLists.txt
lldb/source/Target/RegisterFlags.cpp [new file with mode: 0644]
lldb/unittests/Target/CMakeLists.txt
lldb/unittests/Target/RegisterFlagsTest.cpp [new file with mode: 0644]