Some of our Python scripts still include the line from __future__ import print_function which is intended to allow a Python 2 to handle the Python 3 print() syntax. This particular part of the future arrived many years ago, and our minimum Python version is 3.9, so we don't need to keep this line around. NB: the scripts in tests/tcg/*/gdbstub/ are run with whatever Python gdb was built against, but we can safely assume that that was a Python 3 because our supported distros are all on Python 3. In any case these are only run as part of "make check-tcg", not by end-users. Commit created with: sed -i -e '/import print_function/d' $(git grep -l 'from __future__') Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20250819102409.2117969-1-peter.maydell@linaro.org
25 lines
762 B
Python
25 lines
762 B
Python
#
|
|
# Test gdbstub Xfer:siginfo:read stub.
|
|
#
|
|
# The test runs a binary that causes a SIGSEGV and then looks for additional
|
|
# info about the signal through printing GDB's '$_siginfo' special variable,
|
|
# which sends a Xfer:siginfo:read query to the gdbstub.
|
|
#
|
|
# The binary causes a SIGSEGV at dereferencing a pointer with value 0xdeadbeef,
|
|
# so the test looks for and checks if this address is correctly reported by the
|
|
# gdbstub.
|
|
#
|
|
# This is launched via tests/guest-debug/run-test.py
|
|
#
|
|
|
|
import gdb
|
|
from test_gdbstub import main, report
|
|
|
|
def run_test():
|
|
"Run through the test"
|
|
|
|
gdb.execute("continue", False, True)
|
|
resp = gdb.execute("print/x $_siginfo", False, True)
|
|
report(resp.find("si_addr = 0xdeadbeef"), "Found fault address.")
|
|
|
|
main(run_test)
|