]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/s390x/gdbstub/test-signals-s390x.py
ca2bbc0b03e6ad72de3c31c51b4a5c7adbb0a8b3
1 from __future__
import print_function
4 # Test that signals and debugging mix well together on s390x.
6 # This is launched via tests/guest-debug/run-test.py
15 def report(cond
, msg
):
16 """Report success/fail of test"""
18 print("PASS: %s" % (msg
))
20 print("FAIL: %s" % (msg
))
26 """Run through the tests one by one"""
27 illegal_op
= gdb
.Breakpoint("illegal_op")
28 stg
= gdb
.Breakpoint("stg")
29 mvc_8
= gdb
.Breakpoint("mvc_8")
31 # Expect the following events:
32 # 1x illegal_op breakpoint
33 # 2x stg breakpoint, segv, breakpoint
34 # 2x mvc_8 breakpoint, segv, breakpoint
37 report(illegal_op
.hit_count
== 1, "illegal_op.hit_count == 1")
38 report(stg
.hit_count
== 4, "stg.hit_count == 4")
39 report(mvc_8
.hit_count
== 4, "mvc_8.hit_count == 4")
41 # The test must succeed.
42 gdb
.Breakpoint("_exit")
44 status
= int(gdb
.parse_and_eval("$r2"))
45 report(status
== 0, "status == 0");
49 # This runs as the script it sourced (via -x, via run-test.py)
52 inferior
= gdb
.selected_inferior()
53 arch
= inferior
.architecture()
54 print("ATTACHED: %s" % arch
.name())
55 except (gdb
.error
, AttributeError):
56 print("SKIPPING (not connected)", file=sys
.stderr
)
59 if gdb
.parse_and_eval("$pc") == 0:
60 print("SKIP: PC not set")
64 # Run the actual tests
67 print("GDB Exception: %s" % (sys
.exc_info()[0]))
71 print("All tests complete: %d failures" % failcount
)