[Lldb-commits] [PATCH] D67965: Have ABI plugins vend llvm MCRegisterInfo data

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 24 07:12:33 PDT 2019


labath created this revision.
labath added reviewers: jasonmolenda, aprantl, JDevlieghere, tatyana-krasnukha.
Herald added subscribers: atanasyan, kbarton, mgorny, nemanjai.

I was recently surprised to learn that there is a total of 2 (two) users
of the register info definitions contained in the ABI plugins. Yet, the
defitions themselves span nearly 10kLOC.
The two users are:

- dwarf expression pretty printer
- the mechanism for augmenting the register info definitions obtained over gdb-remote protocol (AugmentRegisterInfoViaABI)

Both of these uses need the DWARF an EH register numbers, which is
information that is already available in LLVM. This patch makes it
possible to do so.

It adds a GetMCRegisterInfo method to the ABI class, which every class
is expected to implement. Normally, it should be sufficient to obtain
the definitions from the appropriate llvm::Target object (for which I
provide a utility function), but the subclasses are free to construct it
in any way they deem fit.

We should be able to always get the MCRegisterInfo object from llvm,
with one important exception: if the relevant llvm target was disabled
at compile time. To handle this, I add a mechanism to disable the
compilation of ABI plugins based on the value of LLVM_TARGETS_TO_BUILD
cmake setting. This ensures all our existing are able to create their
MCRegisterInfo objects.

The new MCRegisterInfo api is not used yet, but the intention is to make
use of it in follow-up patches.


https://reviews.llvm.org/D67965

Files:
  include/lldb/Target/ABI.h
  source/API/CMakeLists.txt
  source/API/SystemInitializerFull.cpp
  source/Plugins/ABI/CMakeLists.txt
  source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
  source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h
  source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
  source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h
  source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
  source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h
  source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
  source/Plugins/ABI/SysV-arm/ABISysV_arm.h
  source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
  source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h
  source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
  source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h
  source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
  source/Plugins/ABI/SysV-i386/ABISysV_i386.h
  source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
  source/Plugins/ABI/SysV-mips/ABISysV_mips.h
  source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
  source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h
  source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
  source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h
  source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
  source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h
  source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
  source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h
  source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
  source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h
  source/Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.cpp
  source/Plugins/ABI/Windows-x86_64/ABIWindows_x86_64.h
  source/Target/ABI.cpp
  tools/lldb-test/CMakeLists.txt
  tools/lldb-test/SystemInitializerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67965.221540.patch
Type: text/x-patch
Size: 27475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190924/e8b711cf/attachment-0001.bin>


More information about the lldb-commits mailing list