This patch removes register set definitions and other redundant code from NativeRegisterContextLinux/RegisterContextPOSIX*_arm.
Register sets are now moved under RegisterInfosPOSIX_arm which now uses RegisterInfoAndSetInterface. This is similar to what we earlier did for AArch64.
Details
Diff Detail
Event Timeline
NativeRegisterContextLinux_arm still uses "Plugins/Process/Utility/lldb-arm-register-enums.h" which I intend to deal in a later patch.
This is great, thanks for doing this. Just a couple of minor comments inline.
lldb/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp | ||
---|---|---|
167 | delete this break. | |
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp | ||
61–63 | Actually, I'd just change this to assert(target_arch.GetMachine() == llvm::Triple::arm) | |
lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp | ||
93–95 | You can skip this if you want to keep things consistent (or put it in a separate patch, etc), but I just realized that this is completely unnecessary. Instead of the assert, we could just make the assert expression _be_ the definition of the constant (k_num_gpr_registers = ((sizeof g_gpr_regnums_arm / sizeof g_gpr_regnums_arm[0]) - 1)). Given that llvm::array_lengthof is constexpr, it might even work to make this llvm::array_lengthof(g_gpr_regnums_arm)-1. | |
lldb/source/Plugins/Process/elf-core/ThreadElfCore.cpp | ||
84–86 | I think you should either keep both aarch64 and arm cases, or delete both of them. I'm fine with either. |
delete this break.