Correct platform path used by ndk-gdb.py.
Bug: http://b/23790835
Change-Id: I5c4d145a99a30b48e78253d55cc2f58bec63d670
diff --git a/ndk-gdb.py b/ndk-gdb.py
index b14655f..ddb8163 100755
--- a/ndk-gdb.py
+++ b/ndk-gdb.py
@@ -37,6 +37,18 @@
except ImportError:
from queue import Queue, Empty # python 3.x
+def get_platform_arch(abi):
+ '''Convert sysprop abi to a platform architecture name.'''
+ if abi.startswith("armeabi"):
+ return "arm"
+ elif abi.startswith("arm64"):
+ return "arm64"
+ elif abi.startswith("mips64"):
+ return "mips64"
+ elif abi.startswith("mips"):
+ return "mips"
+ return abi
+
def find_program(program, extra_paths = []):
''' extra_paths are searched before PATH '''
PATHS = extra_paths+os.environ['PATH'].replace('"','').split(os.pathsep)
@@ -667,7 +679,7 @@
if not retcode:
log('Found device gdbserver: %s' % (device_gdbserver))
else:
- gdbserver_prebuilt_path = ('%s/prebuilt/android-%s/gdbserver/gdbserver' % (NDK, COMPAT_ABI))
+ gdbserver_prebuilt_path = ('%s/prebuilt/android-%s/gdbserver/gdbserver' % (NDK, get_platform_arch(COMPAT_ABI)))
if os.path.isfile(gdbserver_prebuilt_path):
log('Found prebuilt gdbserver. Copying it on device')
retcode,PUSH_OUTPUT=adb_cmd(True,