aboutsummaryrefslogtreecommitdiff
path: root/ndk-gdb
diff options
context:
space:
mode:
authorAlexander Ivchenko <alexander.ivchenko@intel.com>2015-01-22 16:12:36 +0300
committerAlexander Ivchenko <alexander.ivchenko@intel.com>2015-01-22 23:14:50 +0300
commit94b323a8c2c4b89db91f2b4a18a97ff952084299 (patch)
tree82f80ca45924f8f973e896408d5013c4322f9cab /ndk-gdb
parentdac3c4f306450b5192c5f1229e9e0eae46917ba3 (diff)
downloadndk-94b323a8c2c4b89db91f2b4a18a97ff952084299.tar.gz
Three fixes for ndk-gdb and ndk-gdb.py:
1) Always try to use app_process32/app_process64 to avoid pulling symlinks (this does not work on win hosts). 2) Don't change the name of linker64 when pulling it from the device (otherwise symbols from linker64 are not being loaded in 64-bit case). 3) Always pull app_process32/app_process64 as app_process to avoid inconsistency. Change-Id: I1e4f066b77ee2fc37b879c1a1924b8396921539c Signed-off-by: Alexander Ivchenko <alexander.ivchenko@intel.com>
Diffstat (limited to 'ndk-gdb')
-rwxr-xr-xndk-gdb25
1 files changed, 13 insertions, 12 deletions
diff --git a/ndk-gdb b/ndk-gdb
index 6746a057a..a9438f295 100755
--- a/ndk-gdb
+++ b/ndk-gdb
@@ -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`