]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/aarch64/gdbstub/test-sve.py
afd8ece98dd463fc55fb127a21d874b4219d3187
1 from __future__
import print_function
3 # Test the SVE registers are visible and changeable via gdbstub
5 # 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
))
25 "Run through the tests one by one"
27 gdb
.execute("info registers")
28 report(True, "info registers")
30 gdb
.execute("info registers vector")
31 report(True, "info registers vector")
34 frame
= gdb
.selected_frame()
35 for i
in range(0, 32):
37 zreg
= frame
.read_register(rname
)
38 report(True, "Reading %s" % rname
)
40 cmd
= "set $%s.q.u[%d] = 0x%x" % (rname
, j
, MAGIC
)
42 report(True, "%s" % cmd
)
44 reg
= "$%s.q.u[%d]" % (rname
, j
)
45 v
= gdb
.parse_and_eval(reg
)
46 report(str(v
.type) == "uint128_t", "size of %s" % (reg
))
48 cmd
= "set $%s.d.u[%d] = 0x%x" % (rname
, j
, MAGIC
)
50 report(True, "%s" % cmd
)
52 reg
= "$%s.d.u[%d]" % (rname
, j
)
53 v
= gdb
.parse_and_eval(reg
)
54 report(str(v
.type) == "uint64_t", "size of %s" % (reg
))
55 report(int(v
) == MAGIC
, "%s is 0x%x" % (reg
, MAGIC
))
58 # This runs as the script it sourced (via -x, via run-test.py)
61 inferior
= gdb
.selected_inferior()
62 arch
= inferior
.architecture()
63 report(arch
.name() == "aarch64", "connected to aarch64")
64 except (gdb
.error
, AttributeError):
65 print("SKIPPING (not connected)", file=sys
.stderr
)
69 # Run the actual tests
72 print ("GDB Exception: %s" % (sys
.exc_info()[0]))
75 print("All tests complete: %d failures" % failcount
)