diff options
author | Josh Gao <jmgao@google.com> | 2015-09-03 14:06:05 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2015-09-03 18:02:10 -0700 |
commit | e6c26f20127aa1159e66b7541c4eb2a05f7bfc88 (patch) | |
tree | 6ab9861f2c5595b2681a40ed41e8c68496618d16 /ndk-gdb.py | |
parent | 2545ea0743b3976971b2506f108d9f502fbe046b (diff) | |
download | ndk-e6c26f20127aa1159e66b7541c4eb2a05f7bfc88.tar.gz |
Correct platform path used by ndk-gdb.py.
Bug: http://b/23790835
Change-Id: I5c4d145a99a30b48e78253d55cc2f58bec63d670
Diffstat (limited to 'ndk-gdb.py')
-rwxr-xr-x | ndk-gdb.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/ndk-gdb.py b/ndk-gdb.py index b14655fad..ddb8163b3 100755 --- a/ndk-gdb.py +++ b/ndk-gdb.py @@ -37,6 +37,18 @@ try: 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 @@ After one of these, re-install to the device!''' % (PACKAGE_NAME)) 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, |