]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/functional/s390x: Add reverse debugging test for s390x
authorThomas Huth <thuth@redhat.com>
Fri, 28 Nov 2025 13:39:49 +0000 (14:39 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 12 Jan 2026 12:56:28 +0000 (13:56 +0100)
We just have to make sure that we can set the endianness to big endian,
then we can also run this test on s390x.

Reviewed-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251128133949.181828-1-thuth@redhat.com>

tests/functional/reverse_debugging.py
tests/functional/s390x/meson.build
tests/functional/s390x/test_reverse_debug.py [new file with mode: 0755]

index 86fca8d81f1c1aee14b756c217c96df5c3de4824..8b9507674a041aa8b8e87f755a377bb20cc5e98c 100644 (file)
@@ -64,7 +64,7 @@ class ReverseDebugging(LinuxKernelTest):
 
     @skipIfMissingImports("pygdbmi") # Required by GDB class
     @skipIfMissingEnv("QEMU_TEST_GDB")
-    def reverse_debugging(self, gdb_arch, shift=7, args=None):
+    def reverse_debugging(self, gdb_arch, shift=7, args=None, big_endian=False):
         from qemu_test import GDB
 
         # create qcow2 for snapshots
@@ -99,6 +99,8 @@ class ReverseDebugging(LinuxKernelTest):
             gdb_cmd = os.getenv('QEMU_TEST_GDB')
             gdb = GDB(gdb_cmd)
             try:
+                if big_endian:
+                    gdb.cli("set endian big")
                 self.reverse_debugging_run(gdb, vm, port, gdb_arch, last_icount)
             finally:
                 self.log.info('exiting gdb and qemu')
index 70cd36e2913d8cb61bfbf6958caa2c0f1559783e..0f03e1c9db8aadcc350f230ad3eec8c2c7c0a1df 100644 (file)
@@ -6,6 +6,7 @@ test_s390x_timeouts = {
 
 tests_s390x_system_quick = [
   'vmstate',
+  'reverse_debug',
 ]
 
 tests_s390x_system_thorough = [
diff --git a/tests/functional/s390x/test_reverse_debug.py b/tests/functional/s390x/test_reverse_debug.py
new file mode 100755 (executable)
index 0000000..0767dc9
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env python3
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+'''
+Reverse debugging test for s390x
+'''
+
+from reverse_debugging import ReverseDebugging
+
+
+class ReverseDebuggingS390x(ReverseDebugging):
+
+    def test_revdbg(self):
+        self.set_machine('s390-ccw-virtio')
+        self.reverse_debugging(gdb_arch='s390:64-bit', shift=6,
+                               big_endian=True, args=('-no-shutdown',))
+
+
+if __name__ == '__main__':
+    ReverseDebugging.main()