summaryrefslogtreecommitdiffstats
path: root/python-packages
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2016-03-28 10:40:45 -0700
committerJosh Gao <jmgao@google.com>2016-03-28 11:26:03 -0700
commitdc10068c64f936aeba973906d4294af58b770d2d (patch)
treeaab817048e627d2538e242299159a0a1be6489b7 /python-packages
parenta0f62495a46b8d77e2f508356c8fff2fad2819cd (diff)
downloadandroid_development-dc10068c64f936aeba973906d4294af58b770d2d.tar.gz
android_development-dc10068c64f936aeba973906d4294af58b770d2d.tar.bz2
android_development-dc10068c64f936aeba973906d4294af58b770d2d.zip
gdbrunner: don't use getppid to name the log file.
Windows doesn't really have a concept of process parenthood. Bug: https://github.com/android-ndk/ndk/issues/46 Change-Id: I1a47eb42a9eb5d94c95136bb73eac1caabb923c7
Diffstat (limited to 'python-packages')
-rw-r--r--python-packages/gdbrunner/__init__.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/python-packages/gdbrunner/__init__.py b/python-packages/gdbrunner/__init__.py
index 1a7a6b15d..186fc0198 100644
--- a/python-packages/gdbrunner/__init__.py
+++ b/python-packages/gdbrunner/__init__.py
@@ -176,13 +176,12 @@ def start_gdbserver(device, gdbserver_local_path, gdbserver_remote_path,
atexit.register(lambda: device.forward_remove("tcp:{}".format(port)))
gdbserver_cmd = get_run_as_cmd(user, gdbserver_cmd)
- # Use ppid so that the file path stays the same.
- gdbclient_output_path = os.path.join(tempfile.gettempdir(),
- "gdbclient-{}".format(os.getppid()))
- print "Redirecting gdbclient output to {}".format(gdbclient_output_path)
- gdbclient_output = file(gdbclient_output_path, 'w')
- return device.shell_popen(gdbserver_cmd, stdout=gdbclient_output,
- stderr=gdbclient_output)
+ gdbserver_output_path = os.path.join(tempfile.gettempdir(),
+ "gdbclient.log")
+ print("Redirecting gdbserver output to {}".format(gdbserver_output_path))
+ gdbserver_output = file(gdbserver_output_path, 'w')
+ return device.shell_popen(gdbserver_cmd, stdout=gdbserver_output,
+ stderr=gdbserver_output)
def find_file(device, executable_path, sysroot, user=None):