Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: platform_tools/android/bin/android_gdbserver

Issue 22617002: Update Skia Android tools. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # android_gdbserver: Pushes gdbserver. Starts debugging environment. 3 # android_gdbserver: Pushes gdbserver. Starts debugging environment.
4 4
5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6 source $SCRIPT_DIR/android_setup.sh 6 source $SCRIPT_DIR/android_setup.sh
7 source $SCRIPT_DIR/utils/setup_adb.sh
7 8
8 APP_NAME=${APP_ARGS[0]} 9 configuration="Debug"
10 serialNumber=""
11
12 for arg in ${APP_ARGS[@]}
13 do
14 if [[ "${arg}" == "-s" ]];
15 then
16 if [[ $# -lt 2 ]];
17 then
18 echo "ERROR: missing serial number"
19 exit 1;
20 fi
21 serialNumber="-s $2"
22 shift
23 # TODO this is a bug to have $1 and $2
24 elif [[ "$1" == "--release" ]];
25 then
26 configuration="Release"
27 else
28 gdbVars=("${gdbVars[@]}" "${arg}")
29 fi
30
31 shift
32 done
33
34 APP_NAME=${gdbVars[0]}
9 PORT=5039 35 PORT=5039
10 36
11 source $SCRIPT_DIR/utils/setup_adb.sh 37 if [ ! -f "${SKIA_OUT}/${configuration}/lib.target/lib${gdbVars[0]}.so" ];
38 then
39 echo "Unable to find the ${gdbVars[0]} library"
40 exit 1
41 fi
12 42
13 # We need the debug symbols from these files 43 # We need the debug symbols from these files
14 GDB_TMP_DIR=$(pwd)/android_gdb_tmp 44 GDB_TMP_DIR=$(pwd)/android_gdb_tmp
15 mkdir $GDB_TMP_DIR 45 mkdir $GDB_TMP_DIR
46
16 echo "Copying symbol files" 47 echo "Copying symbol files"
17 adb_pull_if_needed /system/bin/skia_launcher $GDB_TMP_DIR
18 adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR 48 adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR
19 adb_pull_if_needed /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR 49 cp "${SKIA_OUT}/${configuration}/skia_launcher" $GDB_TMP_DIR
20 adb_pull_if_needed /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR 50 cp "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" $GDB_TMP_DIR
51 cp "${SKIA_OUT}/${configuration}/lib.target/lib${APP_NAME}.so" $GDB_TMP_DIR
21 52
22 echo "Checking for skia_launcher app..." 53 echo "Pushing app..."
23 if [ ! -f $GDB_TMP_DIR/skia_launcher ] 54 adb_push_if_needed "${SKIA_OUT}/${configuration}/skia_launcher" /data/local/tmp
24 then 55 adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/libskia_android.so" /data/local/tmp
25 echo "Unable for find the skia_launcher on the device" 56 adb_push_if_needed "${SKIA_OUT}/${configuration}/lib.target/lib${APP_NAME}.so" / data/local/tmp
26 rm -rf $GDB_TMP_DIR
27 exit 1;
28 fi
29
30 echo "Checking for $APP_NAME library..."
31 if [ ! -f $GDB_TMP_DIR/lib$APP_NAME.so ]
32 then
33 echo "Unable for find the app's shared library on the device"
34 rm -rf $GDB_TMP_DIR
35 exit 1;
36 fi
37 57
38 echo "Pushing gdbserver..." 58 echo "Pushing gdbserver..."
39 $ADB remount 59 adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver data/local/tmp
40 $ADB push $ANDROID_TOOLCHAIN/../gdbserver /system/bin/gdbserver
41 60
42 echo "Setting up port forward" 61 echo "Setting up port forward"
43 $ADB forward "tcp:5039" "tcp:5039" 62 $ADB forward "tcp:5039" "tcp:5039"
44 63
45 # Kill all previous instances of gdbserver and skia_launcher to rid all port ove rriding errors. 64 # Kill all previous instances of gdbserver and the app to rid all port overridin g errors.
46 echo "Killing any running Skia processes." 65 echo "Killing any running Skia processes."
47 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill 66 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill
48 $ADB shell ps | grep skia_launcher | awk '{print $2}' | xargs $ADB shell kill 67 $ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill
49 68
50 # Starting up gdbserver in android shell 69 # Starting up gdbserver in android shell
51 echo "Starting gdbserver with command: skia_launcher $APP_ARGS" 70 echo "Starting gdbserver with command: ${gdbVars[@]}"
52 $ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_ARGS & 71 $ADB shell /data/local/tmp/gdbserver :5039 /data/local/tmp/skia_launcher ${gdbVa rs[@]} &
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698