aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2016-03-17 10:45:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-17 10:45:47 -0700
commit42d95a0afb26560586232961445ba36de387ca37 (patch)
tree4a035661259aec4c744b4ae39884a8f89d470ac6 /platform_tools/android/bin
parent5a6098217c87080ddb04db18aab82a38ab142aef (diff)
Fix gdb debugging for the latest NDK release.
Diffstat (limited to 'platform_tools/android/bin')
-rwxr-xr-xplatform_tools/android/bin/android_gdb_native2
-rwxr-xr-xplatform_tools/android/bin/android_gdbserver10
-rwxr-xr-xplatform_tools/android/bin/android_setup.sh15
-rw-r--r--platform_tools/android/bin/utils/setup_adb.sh2
-rwxr-xr-xplatform_tools/android/bin/utils/setup_toolchain.sh2
5 files changed, 18 insertions, 13 deletions
diff --git a/platform_tools/android/bin/android_gdb_native b/platform_tools/android/bin/android_gdb_native
index bf6827a25c..417f3a4617 100755
--- a/platform_tools/android/bin/android_gdb_native
+++ b/platform_tools/android/bin/android_gdb_native
@@ -45,7 +45,7 @@ GDBSETUP=$GDB_TMP_DIR/gdb.setup
# Launch gdb client
echo "Entering gdb client shell"
-$ANDROID_TOOLCHAIN/../gdb -x $GDBSETUP
+$ANDROID_TOOLCHAIN/../host_prebuilt/bin/gdb -x $GDBSETUP
# Clean up:
# We could 'rm -rf $GDB_TMP_DIR', but doing so would cause subsequent debugging
diff --git a/platform_tools/android/bin/android_gdbserver b/platform_tools/android/bin/android_gdbserver
index a7b20bff97..d9d1d7eefd 100755
--- a/platform_tools/android/bin/android_gdbserver
+++ b/platform_tools/android/bin/android_gdbserver
@@ -34,15 +34,11 @@ for library_file in \
libm.so \
liblog.so \
libz.so \
- libgccdemangle.so \
libsigchain.so \
libcutils.so \
libunwind.so \
- libunwind-ptrace.so \
libbacktrace.so \
libutils.so \
- libstlport.so \
- libGLES_trace.so \
libEGL.so \
libGLESv2.so \
; do
@@ -76,8 +72,10 @@ $ADB forward "tcp:5039" "tcp:5039"
# Kill all previous instances of gdbserver and the app to rid all port overriding errors.
echo "Killing any running Skia processes."
-$ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill
-$ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill
+set +e
+$ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill 2> /dev/null
+$ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill 2> /dev/null
+set -e
# Starting up gdbserver in android shell
echo "Starting gdbserver with command: ${APP_ARGS[@]}"
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index 3af118ef65..4b7a60f84a 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -219,6 +219,11 @@ adb_push_if_needed() {
local HOST_SRC="$1"
local ANDROID_DST="$2"
+ # disable crashing on failed commands since newer (N+) versions of Android
+ # return an error when attempting to run ls on a directory or file that does
+ # not exist.
+ set +e
+
ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST`
HOST_LS=`ls -ld $HOST_SRC`
if [ "${ANDROID_LS:0:1}" == "d" -a "${HOST_LS:0:1}" == "-" ];
@@ -226,12 +231,11 @@ adb_push_if_needed() {
ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})"
fi
-
- ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST`
+ ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST 2> /dev/null`
if [ "${ANDROID_LS:0:1}" == "-" ]; then
#get the MD5 for dst and src depending on OS and/or OS revision
- ANDROID_MD5_SUPPORT=`$ADB $DEVICE_SERIAL shell ls -ld /system/bin/md5`
- if [ "${ANDROID_MD5_SUPPORT:0:15}" != "/system/bin/md5" ]; then
+ ANDROID_MD5_SUPPORT=`$ADB $DEVICE_SERIAL shell ls -ld /system/bin/md5 2> /dev/null`
+ if [ "${ANDROID_MD5_SUPPORT:0:1}" == "-" ]; then
ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5 $ANDROID_DST`
else
ANDROID_MD5=`$ADB $DEVICE_SERIAL shell md5sum $ANDROID_DST`
@@ -262,6 +266,9 @@ adb_push_if_needed() {
$ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
fi
fi
+
+ # turn error checking back on
+ set -e
}
setup_device "${DEVICE_ID}"
diff --git a/platform_tools/android/bin/utils/setup_adb.sh b/platform_tools/android/bin/utils/setup_adb.sh
index 767027b8cf..e59b43c335 100644
--- a/platform_tools/android/bin/utils/setup_adb.sh
+++ b/platform_tools/android/bin/utils/setup_adb.sh
@@ -21,7 +21,7 @@ if [ ! -x $ADB ]; then
fi
if [ $(uname) == "Linux" ]; then
- ADB_REQUIRED="1.0.32"
+ ADB_REQUIRED="1.0.32 or 1.0.35"
elif [ $(uname) == "Darwin" ]; then
ADB_REQUIRED="1.0.31 or 1.0.32"
fi
diff --git a/platform_tools/android/bin/utils/setup_toolchain.sh b/platform_tools/android/bin/utils/setup_toolchain.sh
index c2c6a52209..0879fc9ecb 100755
--- a/platform_tools/android/bin/utils/setup_toolchain.sh
+++ b/platform_tools/android/bin/utils/setup_toolchain.sh
@@ -60,7 +60,7 @@ function default_toolchain() {
--platform=android-$API \
--install_dir=$TOOLCHAIN
cp $UNZIPPED/prebuilt/android-$ANDROID_ARCH/gdbserver/gdbserver $TOOLCHAIN
- cp $UNZIPPED/prebuilt/${HOST}-x86_64/bin/gdb $TOOLCHAIN
+ cp -r $UNZIPPED/prebuilt/${HOST}-x86_64 $TOOLCHAIN/host_prebuilt
rm $NDK.zip
rm -rf $UNZIPPED
popd