diff options
-rwxr-xr-x | build/tools/build-ndk-sysroot.sh | 1 | ||||
-rwxr-xr-x | ndk-gdb | 25 | ||||
-rwxr-xr-x | ndk-gdb.py | 26 |
3 files changed, 26 insertions, 26 deletions
diff --git a/build/tools/build-ndk-sysroot.sh b/build/tools/build-ndk-sysroot.sh index 13acda0a8..dfb5de0ab 100755 --- a/build/tools/build-ndk-sysroot.sh +++ b/build/tools/build-ndk-sysroot.sh @@ -142,7 +142,6 @@ rm -rf $COMMON_ROOT mkdir -p $COMMON_ROOT LIB_ROOT=$SYSROOT/usr/lib -INCLUDE_ROOT=$SYSROOT/usr/include install_file () { @@ -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)) |