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