xref: /qemu/tests/tcg/s390x/gdbstub/test-svc.py (revision 1c8e621f097362d0a28c65fa2f31054b47a5282b)
1be4a4cb4SIlya Leoshkevich"""Test single-stepping SVC.
2be4a4cb4SIlya Leoshkevich
3be4a4cb4SIlya LeoshkevichThis runs as a sourced script (via -x, via run-test.py)."""
4be4a4cb4SIlya Leoshkevichfrom __future__ import print_function
5be4a4cb4SIlya Leoshkevichimport gdb
6*4d48c1bcSIlya Leoshkevichfrom test_gdbstub import main, report
7be4a4cb4SIlya Leoshkevich
8be4a4cb4SIlya Leoshkevich
9be4a4cb4SIlya Leoshkevichdef run_test():
10be4a4cb4SIlya Leoshkevich    """Run through the tests one by one"""
11be4a4cb4SIlya Leoshkevich    report("lghi\t" in gdb.execute("x/i $pc", False, True), "insn #1")
12be4a4cb4SIlya Leoshkevich    gdb.execute("si")
13be4a4cb4SIlya Leoshkevich    report("larl\t" in gdb.execute("x/i $pc", False, True), "insn #2")
14be4a4cb4SIlya Leoshkevich    gdb.execute("si")
15cb2d7e63SIlya Leoshkevich    report("lgrl\t" in gdb.execute("x/i $pc", False, True), "insn #3")
16be4a4cb4SIlya Leoshkevich    gdb.execute("si")
17be4a4cb4SIlya Leoshkevich    report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #4")
18be4a4cb4SIlya Leoshkevich    gdb.execute("si")
19be4a4cb4SIlya Leoshkevich    report("xgr\t" in gdb.execute("x/i $pc", False, True), "insn #5")
20be4a4cb4SIlya Leoshkevich    gdb.execute("si")
21be4a4cb4SIlya Leoshkevich    report("svc\t" in gdb.execute("x/i $pc", False, True), "insn #6")
22be4a4cb4SIlya Leoshkevich    gdb.execute("si")
23be4a4cb4SIlya Leoshkevich
24be4a4cb4SIlya Leoshkevich
25*4d48c1bcSIlya Leoshkevichmain(run_test)
26