test-proc-mappings.py 842 B

12345678910111213141516171819202122
  1. """Test that gdbstub has access to proc mappings.
  2. This runs as a sourced script (via -x, via run-test.py)."""
  3. from __future__ import print_function
  4. import gdb
  5. from test_gdbstub import main, report
  6. def run_test():
  7. """Run through the tests one by one"""
  8. if gdb.selected_inferior().architecture().name() == "m68k":
  9. # m68k GDB supports only GDB_OSABI_SVR4, but GDB_OSABI_LINUX is
  10. # required for the info proc support (see set_gdbarch_info_proc()).
  11. print("SKIP: m68k GDB does not support GDB_OSABI_LINUX")
  12. exit(0)
  13. mappings = gdb.execute("info proc mappings", False, True)
  14. report(isinstance(mappings, str), "Fetched the mappings from the inferior")
  15. # Broken with host page size > guest page size
  16. # report("/sha1" in mappings, "Found the test binary name in the mappings")
  17. main(run_test)