Skip to content

Commit

Permalink
gdbrunner: don't use getppid to name the log file.
Browse files Browse the repository at this point in the history
Windows doesn't really have a concept of process parenthood.

Bug: android/ndk#46
Change-Id: I1a47eb42a9eb5d94c95136bb73eac1caabb923c7
(cherry picked from commit dc10068)
  • Loading branch information
jmgao committed Mar 28, 2016
1 parent f20a485 commit f877e96
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python-packages/gdbrunner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f877e96

Please sign in to comment.