aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin/android_gdbserver
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-12 12:30:04 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-08-12 12:30:04 +0000
commitcc95b1aeb8cbb9201712c9982d12149b0e0027f0 (patch)
treedcb3eba827fe84f2c24bca6cf00a0f883a10e9ec /platform_tools/android/bin/android_gdbserver
parent36bb270c1e05020d7f8df3bf244309fb44a9fff3 (diff)
Update Skia Android tools.
This CL moves the skia_launcher out of the system/bin and into /data/local/tmp; removes the need to package our shared libs in an apk; and updates all the scripts to work in the new environment. R=mtklein@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/22617002 git-svn-id: http://skia.googlecode.com/svn/trunk@10673 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'platform_tools/android/bin/android_gdbserver')
-rwxr-xr-xplatform_tools/android/bin/android_gdbserver60
1 files changed, 34 insertions, 26 deletions
diff --git a/platform_tools/android/bin/android_gdbserver b/platform_tools/android/bin/android_gdbserver
index 5c45b56acd..04c46f37c8 100755
--- a/platform_tools/android/bin/android_gdbserver
+++ b/platform_tools/android/bin/android_gdbserver
@@ -4,49 +4,57 @@
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=${APP_ARGS[0]}
+APP_NAME=${gdbVars[0]}
PORT=5039
-source $SCRIPT_DIR/utils/setup_adb.sh
+if [ ! -f "${SKIA_OUT}/${configuration}/lib.target/lib${gdbVars[0]}.so" ];
+then
+ echo "Unable to find the ${gdbVars[0]} library"
+ exit 1
+fi
# We need the debug symbols from these files
GDB_TMP_DIR=$(pwd)/android_gdb_tmp
mkdir $GDB_TMP_DIR
+
echo "Copying symbol files"
-adb_pull_if_needed /system/bin/skia_launcher $GDB_TMP_DIR
adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR
-adb_pull_if_needed /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR
-adb_pull_if_needed /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR
-
-echo "Checking for skia_launcher app..."
-if [ ! -f $GDB_TMP_DIR/skia_launcher ]
-then
- echo "Unable for find the skia_launcher on the device"
- rm -rf $GDB_TMP_DIR
- exit 1;
-fi
+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 "Checking for $APP_NAME library..."
-if [ ! -f $GDB_TMP_DIR/lib$APP_NAME.so ]
-then
- echo "Unable for find the app's shared library on the device"
- rm -rf $GDB_TMP_DIR
- exit 1;
-fi
+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
echo "Pushing gdbserver..."
-$ADB remount
-$ADB push $ANDROID_TOOLCHAIN/../gdbserver /system/bin/gdbserver
+adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver data/local/tmp
echo "Setting up port forward"
$ADB forward "tcp:5039" "tcp:5039"
-# Kill all previous instances of gdbserver and skia_launcher to rid all port overriding errors.
+# 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 skia_launcher | 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: skia_launcher $APP_ARGS"
-$ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_ARGS & \ No newline at end of file
+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