[all-commits] [llvm/llvm-project] f838f0: [lldb] Add register field enum class (#90063)
David Spickett via All-commits
all-commits at lists.llvm.org
Mon Jun 17 03:53:53 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f838f08c8def5f49001bba9dc4f682baef04cd14
https://github.com/llvm/llvm-project/commit/f838f08c8def5f49001bba9dc4f682baef04cd14
Author: David Spickett <david.spickett at linaro.org>
Date: 2024-06-17 (Mon, 17 Jun 2024)
Changed paths:
M lldb/include/lldb/Target/RegisterFlags.h
M lldb/source/Target/RegisterFlags.cpp
M lldb/unittests/Target/RegisterFlagsTest.cpp
Log Message:
-----------
[lldb] Add register field enum class (#90063)
This represents the enum type that can be assigned to a field using the
`<enum>` element in the target XML.
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Enum-Target-Types.html
Each enumerator has:
* A non-empty name
* A value that is within the range of the field it's applied to
The XML includes a "size" but we don't need that for anything and it's a
pain to verify so I've left it out of our internal structures. When
emitting XML we'll set size to the size of the register using the enum.
An Enumerator class is added to RegisterFlags and hooked up to the
existing ToXML so lldb-server can use it to emit enums as well.
As enums are elements on the same level as flags, when emitting XML
we'll do so via the registers. Before emitting a flags element we look
at all the fields and see what enums they reference. Then print all of
those if we haven't already done so.
Functions are added to dump enum information for `register info` to use
to show the enum information.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list