]>
git.proxmox.com Git - mirror_qemu.git/blob - tests/tcg/multiarch/gdbstub/sha1.py
1 from __future__
import print_function
3 # A very simple smoke test for debugging the SHA1 userspace test on
6 # This is launched via tests/guest-debug/run-test.py
10 from test_gdbstub
import main
, report
16 def check_break(sym_name
):
17 "Setup breakpoint, continue and check we stopped."
18 sym
, ok
= gdb
.lookup_symbol(sym_name
)
19 bp
= gdb
.Breakpoint(sym_name
)
23 # hopefully we came back
24 end_pc
= gdb
.parse_and_eval('$pc')
25 report(bp
.hit_count
== 1,
26 "break @ %s (%s %d hits)" % (end_pc
, sym
.value(), bp
.hit_count
))
32 "Run through the tests one by one"
34 check_break("SHA1Init")
36 # Check step and inspect values. We do a double next after the
37 # breakpoint as depending on the version of gdb we may step the
38 # preamble and not the first actual line of source.
41 val_ctx
= gdb
.parse_and_eval("context->state[0]")
43 report(int(val_ctx
) == exp_ctx
, "context->state[0] == %x" % exp_ctx
);
46 val_ctx
= gdb
.parse_and_eval("context->state[1]")
48 report(int(val_ctx
) == exp_ctx
, "context->state[1] == %x" % exp_ctx
);
50 # finally check we don't barf inspecting registers
51 gdb
.execute("info registers")