From 7b29d05387232f4693f7127aa57769e3fd4d0ffd Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Tue, 11 Oct 2022 18:37:01 +0900 Subject: [PATCH] gdbrunner: Make sure remote lldb-server has +x Because 'adb push' often misses the executable permission, lldbserver can fail without any meaningful error messages. This may happen when the users are on Windows. To fix that, explicitly chmod remote lldbserver after push. Bug: 185210505 Test: manual Change-Id: I88defd4905a9b902424ae8ef4b38a16932b31f02 --- python-packages/gdbrunner/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-packages/gdbrunner/__init__.py b/python-packages/gdbrunner/__init__.py index 2eabf99d2..e28f34d44 100644 --- a/python-packages/gdbrunner/__init__.py +++ b/python-packages/gdbrunner/__init__.py @@ -171,6 +171,10 @@ def start_gdbserver(device, gdbserver_local_path, gdbserver_remote_path, # Push gdbserver to the target. if gdbserver_local_path is not None: device.push(gdbserver_local_path, chroot + gdbserver_remote_path) + # If the user here is potentially on Windows, adb cannot inspect execute + # permissions. Since we don't know where the users are, chmod + # gdbserver_remote_path on device regardless. + device.shell(["chmod", "+x", gdbserver_remote_path]) # Run gdbserver. gdbserver_cmd = [gdbserver_remote_path]