summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/functionalities
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 14:28:34 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2016-04-14 14:28:34 +0000
commitbb00d0b6b29a2ab1c59d3040a21f14156d8779df (patch)
treecbe5c64120aa89abbfd4cfc9e6d54b958f0e85bd /lldb/packages/Python/lldbsuite/test/functionalities
parent7311bb34f63df58edb4819e5b483b49932b371bd (diff)
downloadbcm5719-llvm-bb00d0b6b29a2ab1c59d3040a21f14156d8779df.tar.gz
bcm5719-llvm-bb00d0b6b29a2ab1c59d3040a21f14156d8779df.zip
Support Linux on SystemZ as platform
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 changed those to simply use plain write watchpoints. ] Differential Revision: http://reviews.llvm.org/D18978 llvm-svn: 266308
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/functionalities')
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py2
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.corebin0 -> 16384 bytes
-rwxr-xr-xlldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.outbin0 -> 2824 bytes
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py1
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py5
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py2
9 files changed, 18 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index c0e5343f3b3..92ffdb69744 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -113,6 +113,8 @@ class BreakpointConditionsTestCase(TestBase):
self.runCmd("breakpoint modify -c ($r0&&i)")
elif re.match("mips",arch):
self.runCmd("breakpoint modify -c ($r2&&i)")
+ elif arch in ['s390x']:
+ self.runCmd("breakpoint modify -c ($r2&&i)")
self.runCmd("run")
self.expect("process status", PROCESS_STOPPED,
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
index 4606846210c..be0ea144133 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
@@ -43,6 +43,9 @@ class DisassemblyTestCase(TestBase):
elif re.match("mips" , arch):
breakpoint_opcodes = ["break"]
instructions = ['lw', 'sw']
+ elif arch in ["s390x"]:
+ breakpoint_opcodes = [".long"]
+ instructions = [' l ', ' a ', ' st ']
else:
# TODO please add your arch here
self.fail('unimplemented for arch = "{arch}"'.format(arch=self.getArchitecture()))
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
index fb876c256b8..59bf6900816 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
@@ -19,6 +19,7 @@ class LinuxCoreTestCase(TestBase):
_i386_pid = 32306
_x86_64_pid = 32259
+ _s390x_pid = 1045
@skipIf(bugnumber="llvm.org/pr26947")
def test_i386(self):
@@ -29,6 +30,10 @@ class LinuxCoreTestCase(TestBase):
"""Test that lldb can read the process information from an x86_64 linux core file."""
self.do_test("x86_64", self._x86_64_pid)
+ def test_s390x(self):
+ """Test that lldb can read the process information from an s390x linux core file."""
+ self.do_test("s390x", self._s390x_pid)
+
def test_same_pid_running(self):
"""Test that we read the information from the core correctly even if we have a running
process with the same PID around"""
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.core b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.core
new file mode 100644
index 00000000000..b97fc43e967
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.core
Binary files differ
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.out b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.out
new file mode 100755
index 00000000000..640fbdc257d
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/s390x.out
Binary files differ
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
index ce30d269bbf..4183e18e758 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
@@ -33,6 +33,7 @@ class HelloWatchLocationTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
@expectedFailureAll(triple = re.compile('^mips')) # Most of the MIPS boards provide only one H/W watchpoints, and S/W watchpoints are not supported yet
+ @expectedFailureAll(archs=['s390x']) # SystemZ also currently supports only one H/W watchpoint
@skipIfDarwin
def test_hello_watchlocation(self):
"""Test watching a location with '-s size' option."""
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
index bea438b43fe..22011f11352 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -20,6 +20,7 @@ class TestStepOverWatchpoint(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["linux"], archs=['aarch64', 'arm'], bugnumber="llvm.org/pr26031")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test(self):
"""Test stepping over watchpoints."""
self.build()
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
index 9ad0052c73c..4ce05af96e2 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
@@ -32,6 +32,7 @@ class WatchpointCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test_rw_watchpoint(self):
"""Test read_write watchpoint and expect to stop two times."""
self.build(dictionary=self.d)
@@ -92,6 +93,7 @@ class WatchpointCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test_rw_watchpoint_delete(self):
"""Test delete watchpoint and expect not to stop for watchpoint."""
self.build(dictionary=self.d)
@@ -137,6 +139,7 @@ class WatchpointCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test_rw_watchpoint_set_ignore_count(self):
"""Test watchpoint ignore count and expect to not to stop at all."""
self.build(dictionary=self.d)
@@ -186,6 +189,7 @@ class WatchpointCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test_rw_disable_after_first_stop(self):
"""Test read_write watchpoint but disable it after the first stop."""
self.build(dictionary=self.d)
@@ -245,6 +249,7 @@ class WatchpointCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ @expectedFailureAll(archs=['s390x']) # Read-write watchpoints not supported on SystemZ
def test_rw_disable_then_enable(self):
"""Test read_write watchpoint, disable initially, then enable it."""
self.build(dictionary=self.d)
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
index 81e9db7a07f..4240628e7bf 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
@@ -59,7 +59,7 @@ class TestWatchpointEvents (TestBase):
self.listener.StartListeningForEvents (self.target_bcast, lldb.SBTarget.eBroadcastBitWatchpointChanged)
error = lldb.SBError()
- local_watch = local_var.Watch(True, True, True, error)
+ local_watch = local_var.Watch(True, False, True, error)
if not error.Success():
self.fail ("Failed to make watchpoint for local_var: %s"%(error.GetCString()))
OpenPOWER on IntegriCloud