]> git.proxmox.com Git - mirror_qemu.git/blobdiff - tests/guest-debug/run-test.py
tests/tcg: Factor out gdbstub test functions
[mirror_qemu.git] / tests / guest-debug / run-test.py
index b13b27d4b193139934f99ab162930be9af7896ce..368ff8a89030d59a7eb3ce40236bc8d1d459ad75 100755 (executable)
@@ -97,7 +97,12 @@ if __name__ == '__main__':
     sleep(1)
     log(output, "GDB CMD: %s" % (gdb_cmd))
 
-    result = subprocess.call(gdb_cmd, shell=True, stdout=output, stderr=stderr)
+    gdb_env = dict(os.environ)
+    gdb_pythonpath = gdb_env.get("PYTHONPATH", "").split(os.pathsep)
+    gdb_pythonpath.append(os.path.dirname(os.path.realpath(__file__)))
+    gdb_env["PYTHONPATH"] = os.pathsep.join(gdb_pythonpath)
+    result = subprocess.call(gdb_cmd, shell=True, stdout=output, stderr=stderr,
+                             env=gdb_env)
 
     # A result of greater than 128 indicates a fatal signal (likely a
     # crash due to gdb internal failure). That's a problem for GDB and