[all-commits] [llvm/llvm-project] f84bac: [lldb] Introduce RegisterType base class for all r...
David Spickett via All-commits
all-commits at lists.llvm.org
Mon Aug 3 05:31:31 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: f84bacf82a153a75dbf549d8c25d6e73673ea043
https://github.com/llvm/llvm-project/commit/f84bacf82a153a75dbf549d8c25d6e73673ea043
Author: David Spickett <david.spickett at arm.com>
Date: 2026-08-03 (Mon, 03 Aug 2026)
Changed paths:
M lldb/include/lldb/Utility/RegisterFlags.h
M lldb/include/lldb/Utility/RegisterInfo.h
A lldb/include/lldb/Utility/RegisterType.h
M lldb/source/Core/DumpRegisterInfo.cpp
M lldb/source/Core/DumpRegisterValue.cpp
M lldb/source/Plugins/Process/Utility/RegisterFlagsDetector_arm64.cpp
M lldb/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_riscv32.cpp
M lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
M lldb/source/Utility/CMakeLists.txt
M lldb/source/Utility/RegisterFlags.cpp
A lldb/source/Utility/RegisterType.cpp
M lldb/unittests/Target/RegisterFlagsTest.cpp
Log Message:
-----------
[lldb] Introduce RegisterType base class for all register type classes (#196960)
This is refactoring to prepare for
https://github.com/llvm/llvm-project/issues/87471. Where we will be
adding support for describing registers as unions and vectors. See:
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Target-Description-Format.html
A union is like a C union and references other types defined in the XML.
Just like a set of register flags might reference an enum for one of
those flags.
By introducing this base class I'm making the treatment of all these
different types generic. So that when encoding them as XML we can emit
the type's dependencies recursively, and then emit the type itself.
This strategy will also be used later in RegisterTypeBuilderClang to
generate AST to represent these types.
As GDB decided to include size in enums, whenever we emit something it
will get a "user" pointer. This allows an enum type to read the size of
the register it's being attached to. No other type class requires this.
I would call this "parent" but it is not usually the parent. The
heirarchy is:
* A RegisterFlags type contains many flags.
* One of those flags has an enum as its type.
* That enum needs to query two levels up to get the RegisterFlag's size.
LLDB does not care about this enum size attribute, but GDB does so we
emit it for compatibility.
I don't expect anything other than a RegisterFlags to reference an enum
at this time. In theory, a vector's element could be an enum but I do
not know of anything available today that does this.
I'd like to support arbitrary nesting of these types, but only later
once known use cases work well.
For the time being, the generic RegisterType pointer is cast into a
RegisterFlags before use. In future this will become a switch over the
possible register types we support.
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