master
py 25 lines 762 Bytes
Raw
1 #
2 # Test gdbstub Xfer:siginfo:read stub.
3 #
4 # The test runs a binary that causes a SIGSEGV and then looks for additional
5 # info about the signal through printing GDB's '$_siginfo' special variable,
6 # which sends a Xfer:siginfo:read query to the gdbstub.
7 #
8 # The binary causes a SIGSEGV at dereferencing a pointer with value 0xdeadbeef,
9 # so the test looks for and checks if this address is correctly reported by the
10 # gdbstub.
11 #
12 # This is launched via tests/guest-debug/run-test.py
13 #
14
15 import gdb
16 from test_gdbstub import main, report
17
18 def run_test():
19 "Run through the test"
20
21 gdb.execute("continue", False, True)
22 resp = gdb.execute("print/x $_siginfo", False, True)
23 report(resp.find("si_addr = 0xdeadbeef"), "Found fault address.")
24
25 main(run_test)