aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin/android_gdbserver
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-24 18:36:36 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-04-24 18:36:36 +0000
commit44566e2a157915974cfc08819e8f9182690092a1 (patch)
tree1091f93e3a66efe4a91d0cb659f85318eb647332 /platform_tools/android/bin/android_gdbserver
parentb45bd1f7fd60dbaa38340359f14e96b6a475d12d (diff)
Fix android_gdbserver script to work with changes from a137675.
Also stop assuming ANDROID_ARCH one of x86 or arm. NOTRY=true R=mtklein@google.com, djsollen@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/256413006 git-svn-id: http://skia.googlecode.com/svn/trunk@14358 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'platform_tools/android/bin/android_gdbserver')
-rwxr-xr-xplatform_tools/android/bin/android_gdbserver40
1 files changed, 15 insertions, 25 deletions
diff --git a/platform_tools/android/bin/android_gdbserver b/platform_tools/android/bin/android_gdbserver
index 04c46f37c8..960b02926e 100755
--- a/platform_tools/android/bin/android_gdbserver
+++ b/platform_tools/android/bin/android_gdbserver
@@ -6,26 +6,14 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
source $SCRIPT_DIR/utils/setup_adb.sh
-configuration="Debug"
-
-for arg in ${APP_ARGS[@]}
-do
- if [[ "${arg}" == "--release" ]];
- then
- configuration="Release"
- else
- gdbVars=("${gdbVars[@]}" "${arg}")
- fi
-
-shift
-done
-
-APP_NAME=${gdbVars[0]}
+APP_NAME=${APP_ARGS[0]}
PORT=5039
-if [ ! -f "${SKIA_OUT}/${configuration}/lib.target/lib${gdbVars[0]}.so" ];
+BUILD_DIR="${SKIA_OUT}/${BUILDTYPE}"
+TARGET_LIBRARY="${BUILD_DIR}/lib/lib${APP_NAME}.so"
+if [ ! -f "$TARGET_LIBRARY" ]
then
- echo "Unable to find the ${gdbVars[0]} library"
+ echo "Unable to find the ${APP_NAME} library at ${TARGET_LIBRARY}."
exit 1
fi
@@ -35,14 +23,16 @@ mkdir $GDB_TMP_DIR
echo "Copying symbol files"
adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR
-cp "${SKIA_OUT}/${configuration}/skia_launcher" $GDB_TMP_DIR
-cp "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" $GDB_TMP_DIR
-cp "${SKIA_OUT}/${configuration}/lib.target/lib${APP_NAME}.so" $GDB_TMP_DIR
echo "Pushing app..."
-adb_push_if_needed "${SKIA_OUT}/${configuration}/skia_launcher" /data/local/tmp
-adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" /data/local/tmp
-adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/lib${APP_NAME}.so" /data/local/tmp
+for file in \
+ "${BUILD_DIR}/skia_launcher" \
+ "${BUILD_DIR}/lib/libskia_android.so" \
+ "${BUILD_DIR}/lib/lib${APP_NAME}.so" \
+ ; do
+ cp "$file" $GDB_TMP_DIR
+ adb_push_if_needed "$file" /data/local/tmp
+done
echo "Pushing gdbserver..."
adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver data/local/tmp
@@ -56,5 +46,5 @@ $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
# Starting up gdbserver in android shell
-echo "Starting gdbserver with command: ${gdbVars[@]}"
-$ADB shell /data/local/tmp/gdbserver :5039 /data/local/tmp/skia_launcher ${gdbVars[@]} & \ No newline at end of file
+echo "Starting gdbserver with command: ${APP_ARGS[@]}"
+$ADB shell /data/local/tmp/gdbserver :5039 /data/local/tmp/skia_launcher ${APP_ARGS[@]} & \ No newline at end of file