diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2015-01-27 19:01:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-27 19:01:46 +0000 |
commit | 844d2243717ccc9d438c5f10223f8bd37edf40c6 (patch) | |
tree | 82f80ca45924f8f973e896408d5013c4322f9cab | |
parent | dac3c4f306450b5192c5f1229e9e0eae46917ba3 (diff) | |
parent | 94b323a8c2c4b89db91f2b4a18a97ff952084299 (diff) | |
download | ndk-844d2243717ccc9d438c5f10223f8bd37edf40c6.tar.gz |
Merge "Three fixes for ndk-gdb and ndk-gdb.py:"
-rwxr-xr-x | ndk-gdb | 25 | ||||
-rwxr-xr-x | ndk-gdb.py | 26 |
2 files changed, 26 insertions, 25 deletions
@@ -789,29 +789,30 @@ if [ $? != 0 ] ; then exit 1 fi -# If we are debugging 32-bit application on 64-bit device -# then we need to pull app_process32, not app_process -APP_PROCESS_NAME=app_process -if [ "$COMPAT_ABI_BITS" = 32 ] && [ -n "$CPU_ABILIST64" ] ; then - APP_PROCESS_NAME=app_process32 - log "We are debugging 32-bit app on 64-bit device" -fi - -# If we are debugging 64-bit app, then we need to pull linker64 -# and libc.so from lib64 directory +# If we are debugging 64-bit app, then we need to pull linker64, +# app_process64 and libc.so from lib64 directory LINKER_NAME=linker LIBDIR_NAME=lib +APP_PROCESS_NAME=app_process32 if [ "$COMPAT_ABI_BITS" = 64 ] ; then LINKER_NAME=linker64 LIBDIR_NAME=lib64 + APP_PROCESS_NAME=app_process64 +else + # Old 32-bit devices do not have app_process32. Pull + # app_process in this case + run adb_cmd shell test -e /system/bin/$APP_PROCESS_NAME + if [ $? != 0 ] ; then + APP_PROCESS_NAME=app_process + fi fi # Get the app_server binary from the device -APP_PROCESS=$APP_OUT/$APP_PROCESS_NAME +APP_PROCESS=$APP_OUT/app_process run adb_cmd pull /system/bin/$APP_PROCESS_NAME `native_path $APP_PROCESS` log "Pulled $APP_PROCESS_NAME from device/emulator." -run adb_cmd pull /system/bin/$LINKER_NAME `native_path $APP_OUT/linker` +run adb_cmd pull /system/bin/$LINKER_NAME `native_path $APP_OUT/$LINKER_NAME` log "Pulled $LINKER_NAME from device/emulator." run adb_cmd pull /system/$LIBDIR_NAME/libc.so `native_path $APP_OUT/libc.so` diff --git a/ndk-gdb.py b/ndk-gdb.py index a33860bce..7dfba8721 100755 --- a/ndk-gdb.py +++ b/ndk-gdb.py @@ -774,28 +774,28 @@ After one of these, re-install to the device!''' % (PACKAGE_NAME)) error('''Could not setup network redirection to gdbserver? Maybe using --port=<port> to use a different TCP port might help?''') - # If we are debugging 32-bit application on 64-bit device - # then we need to pull app_process32, not app_process - device_app_process = 'app_process' - if (device_bits == 64) and (app_bits == 32): - log('We are debuggin 32-bit app on 64-bit devices') - device_app_process = 'app_process32' - - # If we are debugging 64-bit app, then we need to pull linker64 - # and libc.so from lib64 directory. + # If we are debugging 64-bit app, then we need to pull linker64, + # app_process64 and libc.so from lib64 directory. linker_name = 'linker' libdir_name = 'lib' + app_process_name = 'app_process32' if (app_bits == 64): linker_name = 'linker64' libdir_name = 'lib64' - + app_process_name = 'app_process64' + else: + retcode,_ = adb_cmd(False, ['shell', 'test -e /system/bin/%s' % (app_process_name)]) + if retcode: + # Old 32-bit devices do not have app_process32. Pull + # app_process in this case + app_process_name = 'app_process' # Get the app_server binary from the device pulled_app_process = '%s/app_process' % (APP_OUT) - adb_cmd(False, ['pull', '/system/bin/%s' % (device_app_process), pulled_app_process], log_command=True) - log('Pulled %s from device/emulator.' % (device_app_process)) + adb_cmd(False, ['pull', '/system/bin/%s' % (app_process_name), pulled_app_process], log_command=True) + log('Pulled %s from device/emulator.' % (app_process_name)) - pulled_linker = '%s/linker' % (APP_OUT) + pulled_linker = '%s/%s' % (APP_OUT, linker_name) adb_cmd(False, ['pull', '/system/bin/%s' % (linker_name), pulled_linker], log_command=True) log('Pulled %s from device/emulator.' % (linker_name)) |