[Lldb-commits] [PATCH] D18978: Support Linux on SystemZ as platform

Ulrich Weigand via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 11 11:32:31 PDT 2016


uweigand created this revision.
uweigand added reviewers: labath, tberghammer, clayborg.
uweigand added a subscriber: lldb-commits.
uweigand added a dependency: D18977: Add new ABI callback to return CFA offset.

This patch adds support for Linux on SystemZ:
- A new ArchSpec value of eCore_s390x_generic
- A new directory Plugins/ABI/SysV-s390x providing an ABI implementation
- Register context support
- Native Linux support including watchpoint support
- ELF core file support
- Misc. support throughout the code base (e.g. breakpoint opcodes)
- Test case updates to support the platform

This should provide complete support for debugging the SystemZ platform.
Not yet supported are optional features like transaction support (zEC12)
or SIMD vector support (z13).

There is no instruction emulation, since our ABI requires that all code
provide correct DWARF CFI at all PC locations in .eh_frame to support
unwinding (i.e. -fasynchronous-unwind-tables is on by default).

The implementation follows existing platforms in a mostly straightforward
manner.  A couple of things that are different:

- We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers,
  since some registers (access register) reside at offsets in the user area
  that are multiples of 4, but the PTRACE_PEEKUSER interface only allows
  accessing aligned 8-byte blocks in the user area.  Instead, we use a s390
  specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that
  allows accessing a whole block of the user area in one go, so in effect
  allowing to treat parts of the user area as register sets.

- SystemZ hardware does not provide any means to implement read watchpoints,
  only write watchpoints.  In fact, we can only support a *single* write
  watchpoint (but this can span a range of arbitrary size).  In LLDB this
  means we support only a single watchpoint.  I've set all test cases that
  require read watchpoints (or multiple watchpoints) to expected failure
  on the platform.  [ Note that there were two test cases that install
  a read/write watchpoint even though they nowhere rely on the "read"
  property.  I've changes those to simply use plain write watchpoints. ]

This patch depends on D18977 to add the CFAOffset ABI callback.


http://reviews.llvm.org/D18978

Files:
  cmake/LLDBDependencies.cmake
  include/lldb/Core/ArchSpec.h
  packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
  packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
  packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
  packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
  packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
  packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
  packages/Python/lldbsuite/test/lldbplatformutil.py
  packages/Python/lldbsuite/test/make/Makefile.rules
  packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
  packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
  packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
  packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
  packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
  packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  source/API/SystemInitializerFull.cpp
  source/Core/ArchSpec.cpp
  source/Host/common/HostInfoBase.cpp
  source/Plugins/ABI/CMakeLists.txt
  source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
  source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h
  source/Plugins/ABI/SysV-s390x/CMakeLists.txt
  source/Plugins/ObjectFile/ELF/ELFHeader.cpp
  source/Plugins/Platform/Linux/PlatformLinux.cpp
  source/Plugins/Process/Linux/CMakeLists.txt
  source/Plugins/Process/Linux/NativeProcessLinux.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
  source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h
  source/Plugins/Process/Utility/CMakeLists.txt
  source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp
  source/Plugins/Process/Utility/RegisterContextLinux_s390x.h
  source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
  source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h
  source/Plugins/Process/Utility/RegisterContext_s390x.h
  source/Plugins/Process/Utility/RegisterInfos_s390x.h
  source/Plugins/Process/Utility/lldb-s390x-register-enums.h
  source/Plugins/Process/elf-core/CMakeLists.txt
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp
  source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
  source/Plugins/Process/elf-core/ThreadElfCore.cpp
  source/Plugins/Process/elf-core/ThreadElfCore.h
  source/Target/Platform.cpp
  source/Target/Thread.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18978.53293.patch
Type: text/x-patch
Size: 119549 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160411/b3172ce6/attachment-0001.bin>


More information about the lldb-commits mailing list