[Lldb-commits] [PATCH] D40133: elf-core: Convert remaining register context to use register set maps

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 16 08:16:02 PST 2017


labath created this revision.
Herald added subscribers: kbarton, kristof.beyls, javed.absar, nemanjai, emaste, aemerson.

In https://reviews.llvm.org/D39681, we started using a map instead passing a long list of
register sets to the ppc64le register context. However, existing
register sets were still using the old method.

This converts remaining register contexts to use the register set map.
While doing this, I realized that using OS-specific keys for the map was
not a good idea, as sometimes we have a register context shared between
two OSs (e.g. linux and freebsd share the arm/arm64 register contexts).
Therefore, I create a new enum to represent register sets in an
OS-independent manner (the enum contains the generic GPR and FPR values,
but the rest of the values are likely to be architecture-specific).

This saves a bit of code now, but the real impact I see here is that it
can potentially pave the way for reduction of the number of register
context classes (for example RegisterContextPOSIXCore_arm and
RegisterContextPOSIXCore_arm64 are identical except that we initialize
them with a different RegisterInfoInterface object).


https://reviews.llvm.org/D40133

Files:
  source/Plugins/Process/elf-core/ProcessElfCore.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_ppc64le.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h
  source/Plugins/Process/elf-core/elf-core-enums.h
  source/Plugins/Process/minidump/ThreadMinidump.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40133.123189.patch
Type: text/x-patch
Size: 28352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171116/c73b1996/attachment-0001.bin>


More information about the lldb-commits mailing list