]> git.proxmox.com Git - mirror_qemu.git/blame - tests/tcg/s390x/gdbstub/test-signals-s390x.py
Merge tag 'pull-trivial-patches' of https://gitlab.com/mjt0k/qemu into staging
[mirror_qemu.git] / tests / tcg / s390x / gdbstub / test-signals-s390x.py
CommitLineData
e7f8a3aa
IL
1from __future__ import print_function
2
3#
4# Test that signals and debugging mix well together on s390x.
5#
6# This is launched via tests/guest-debug/run-test.py
7#
8
9import gdb
4d48c1bc 10from test_gdbstub import main, report
e7f8a3aa
IL
11
12
13def run_test():
14 """Run through the tests one by one"""
15 illegal_op = gdb.Breakpoint("illegal_op")
16 stg = gdb.Breakpoint("stg")
17 mvc_8 = gdb.Breakpoint("mvc_8")
18
19 # Expect the following events:
20 # 1x illegal_op breakpoint
21 # 2x stg breakpoint, segv, breakpoint
22 # 2x mvc_8 breakpoint, segv, breakpoint
23 for _ in range(14):
24 gdb.execute("c")
25 report(illegal_op.hit_count == 1, "illegal_op.hit_count == 1")
26 report(stg.hit_count == 4, "stg.hit_count == 4")
27 report(mvc_8.hit_count == 4, "mvc_8.hit_count == 4")
28
29 # The test must succeed.
30 gdb.Breakpoint("_exit")
31 gdb.execute("c")
32 status = int(gdb.parse_and_eval("$r2"))
4d48c1bc 33 report(status == 0, "status == 0")
e7f8a3aa 34
e7f8a3aa 35
4d48c1bc 36main(run_test)