Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 deviceID="" | |
| 5 if [[ $(echo "$1" | grep "^-d$") != "" ]]; | |
| 6 then | |
| 7 deviceID="$2" | |
| 8 fi | |
| 9 | |
| 10 # hack for x86 support in android_setup.sh | |
| 11 if [ "$deviceID" == "x86" ] || [ "$deviceID" == "razr_i" ] | |
| 12 then | |
| 13 ANDROID_ARCH="x86" | |
| 14 fi | |
|
djsollen
2013/07/22 13:18:18
you should be able to remove this code altogether.
| |
| 4 | 15 |
| 5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 16 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 6 APP_NAME=$(basename $1) | 17 APP_NAME=$(basename $3) |
| 7 PORT=5039 | 18 PORT=5039 |
| 8 | 19 |
| 9 # Collect extra arguments to be passed to the Skia binary | 20 # Collect extra arguments to be passed to the Skia binary |
| 10 shift | 21 shift |
| 11 while (( "$#" )); do | 22 while (( "$#" )); do |
| 12 APP_ARGS="$APP_ARGS $1" | 23 APP_ARGS="$APP_ARGS $3" |
| 13 shift | 24 shift |
| 14 done | 25 done |
| 15 | 26 |
| 16 source $SCRIPT_DIR/android_setup.sh | 27 source $SCRIPT_DIR/android_setup.sh |
| 17 source $SCRIPT_DIR/utils/setup_adb.sh | 28 source $SCRIPT_DIR/utils/setup_adb.sh |
| 18 | 29 |
| 19 # We need the debug symbols from these files | 30 # We need the debug symbols from these files |
| 20 GDB_TMP_DIR=$(pwd)/android_gdb_tmp | 31 GDB_TMP_DIR=$(pwd)/android_gdb_tmp |
| 21 mkdir $GDB_TMP_DIR | 32 mkdir $GDB_TMP_DIR |
| 22 echo "Copying symbol files" | 33 echo "Copying symbol files" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 43 | 54 |
| 44 echo "Pushing gdbserver..." | 55 echo "Pushing gdbserver..." |
| 45 $ADB remount | 56 $ADB remount |
| 46 $ADB push $ANDROID_TOOLCHAIN/../gdbserver /system/bin/gdbserver | 57 $ADB push $ANDROID_TOOLCHAIN/../gdbserver /system/bin/gdbserver |
| 47 | 58 |
| 48 echo "Setting up port forward" | 59 echo "Setting up port forward" |
| 49 $ADB forward "tcp:5039" "tcp:5039" | 60 $ADB forward "tcp:5039" "tcp:5039" |
| 50 | 61 |
| 51 # Kill all previous instances of gdbserver and skia_launcher to rid all port ove rriding errors. | 62 # Kill all previous instances of gdbserver and skia_launcher to rid all port ove rriding errors. |
| 52 echo "Killing any running Skia processes." | 63 echo "Killing any running Skia processes." |
| 53 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill | 64 $ADB shell ps | grep gdbserver | awk '{print $4}' | xargs $ADB shell kill |
| 54 $ADB shell ps | grep skia_launcher | awk '{print $2}' | xargs $ADB shell kill | 65 $ADB shell ps | grep skia_launcher | awk '{print $4}' | xargs $ADB shell kill |
| 55 | |
| 56 # Starting up gdbserver in android shell | 66 # Starting up gdbserver in android shell |
| 57 echo "Starting gdbserver with command: skia_launcher $APP_NAME$APP_ARGS" | 67 echo "Starting gdbserver with command: skia_launcher $APP_NAME$APP_ARGS" |
| 58 $ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_NAME$APP_ARGS & | 68 $ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_NAME$APP_ARGS & |
| OLD | NEW |