qemu-e2k/tests/tcg/s390x/gdbstub/test-svc.py
Ilya Leoshkevich 4d48c1bc07 tests/tcg: Factor out gdbstub test functions
Both the report() function as well as the initial gdbstub test sequence
are copy-pasted into ~10 files with slight modifications. This
indicates that they are indeed generic, so factor them out. While
at it, add a few newlines to make the formatting closer to PEP-8.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20240129093410.3151-3-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2024-01-29 20:48:49 +10:00

26 lines
810 B
Python

"""Test single-stepping SVC.
This runs as a sourced script (via -x, via run-test.py)."""
from __future__ import print_function
import gdb
from test_gdbstub import main, report
def run_test():
"""Run through the tests one by one"""
report("lghi\t" in gdb.execute("x/i $pc", False, True), "insn #1")
gdb.execute("si")
report("larl\t" in gdb.execute("x/i $pc", False, True), "insn #2")
gdb.execute("si")
report("lgrl\t" in gdb.execute("x/i $pc", False, True), "insn #3")
gdb.execute("si")
report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #4")
gdb.execute("si")
report("xgr\t" in gdb.execute("x/i $pc", False, True), "insn #5")
gdb.execute("si")
report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #6")
gdb.execute("si")
main(run_test)