]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/s390x/gdbstub/test-svc.py
18fad3f163da150b28e3d451b7ee6558aaed2646
1 """Test single-stepping SVC.
3 This runs as a sourced script (via -x, via run-test.py)."""
4 from __future__
import print_function
12 def report(cond
, msg
):
13 """Report success/fail of a test"""
15 print("PASS: {}".format(msg
))
17 print("FAIL: {}".format(msg
))
23 """Run through the tests one by one"""
24 report("lghi\t" in gdb
.execute("x/i $pc", False, True), "insn #1")
26 report("larl\t" in gdb
.execute("x/i $pc", False, True), "insn #2")
28 report("lgrl\t" in gdb
.execute("x/i $pc", False, True), "insn #3")
30 report("svc\t" in gdb
.execute("x/i $pc", False, True), "insn #4")
32 report("xgr\t" in gdb
.execute("x/i $pc", False, True), "insn #5")
34 report("svc\t" in gdb
.execute("x/i $pc", False, True), "insn #6")
39 """Prepare the environment and run through the tests"""
41 inferior
= gdb
.selected_inferior()
42 print("ATTACHED: {}".format(inferior
.architecture().name()))
43 except (gdb
.error
, AttributeError):
44 print("SKIPPING (not connected)")
47 if gdb
.parse_and_eval('$pc') == 0:
48 print("SKIP: PC not set")
52 # These are not very useful in scripts
53 gdb
.execute("set pagination off")
54 gdb
.execute("set confirm off")
56 # Run the actual tests
59 report(False, "GDB Exception: {}".format(sys
.exc_info()[0]))
60 print("All tests complete: %d failures" % n_failures
)