On 6/30/23 11:04, Alex Bennée wrote:
From: Ilya Leoshkevich <i...@linux.ibm.com>

Add a small test to prevent regressions.

Signed-off-by: Ilya Leoshkevich <i...@linux.ibm.com>
Message-Id: <20230621203627.1808446-9-...@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
...
+def run_test():
+    """Run through the tests one by one"""
+    try:
+        mappings = gdb.execute("info proc mappings", False, True)
+    except gdb.error as exc:
+        exc_str = str(exc)
+        if "Not supported on this target." in exc_str:
+            # Detect failures due to an outstanding issue with how GDB handles
+            # the x86_64 QEMU's target.xml, which does not contain the
+            # definition of orig_rax. Skip the test in this case.
+            print("SKIP: {}".format(exc_str))
+            return
+        raise
+    report(isinstance(mappings, str), "Fetched the mappings from the inferior")
+    report("/sha1" in mappings, "Found the test binary name in the mappings")

This test fails on ppc64 host, or indeed any host with page size != 4k.

When host page size != target page size, and the executable image is small, such as sha1, then target_mmap cannot directly map the executable file, but must implement the mmap via MAP_ANON + pread. Which leaves us with no binary name in the host /proc/self/maps for us to copy to the artificial guest /proc/self/maps.

One of the very many issues with page size mismatch...

I'm tempted to remove the test, but I suppose we could check host page size in 
python.


r~


Reply via email to