| 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 | 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 source $SCRIPT_DIR/utils/setup_adb.sh |
| 8 | 8 |
| 9 APP_NAME=${APP_ARGS[0]} | 9 APP_NAME=${APP_ARGS[0]} |
| 10 PORT=5039 | 10 PORT=5039 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 for file in \ | 46 for file in \ |
| 47 "${BUILD_DIR}/skia_launcher" \ | 47 "${BUILD_DIR}/skia_launcher" \ |
| 48 "${BUILD_DIR}/lib/libskia_android.so" \ | 48 "${BUILD_DIR}/lib/libskia_android.so" \ |
| 49 "${BUILD_DIR}/lib/lib${APP_NAME}.so" \ | 49 "${BUILD_DIR}/lib/lib${APP_NAME}.so" \ |
| 50 ; do | 50 ; do |
| 51 cp "$file" $GDB_TMP_DIR | 51 cp "$file" $GDB_TMP_DIR |
| 52 adb_push_if_needed "$file" /data/local/tmp | 52 adb_push_if_needed "$file" /data/local/tmp |
| 53 done | 53 done |
| 54 | 54 |
| 55 echo "Pushing gdbserver..." | 55 echo "Pushing gdbserver..." |
| 56 adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver data/local/tmp | 56 adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver /data/local/tmp |
| 57 | 57 |
| 58 echo "Setting up port forward" | 58 echo "Setting up port forward" |
| 59 $ADB forward "tcp:5039" "tcp:5039" | 59 $ADB forward "tcp:5039" "tcp:5039" |
| 60 | 60 |
| 61 # Kill all previous instances of gdbserver and the app to rid all port overridin
g errors. | 61 # Kill all previous instances of gdbserver and the app to rid all port overridin
g errors. |
| 62 echo "Killing any running Skia processes." | 62 echo "Killing any running Skia processes." |
| 63 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill | 63 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill |
| 64 $ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill | 64 $ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill |
| 65 | 65 |
| 66 # Starting up gdbserver in android shell | 66 # Starting up gdbserver in android shell |
| 67 echo "Starting gdbserver with command: ${APP_ARGS[@]}" | 67 echo "Starting gdbserver with command: ${APP_ARGS[@]}" |
| 68 $ADB shell /data/local/tmp/gdbserver :5039 /data/local/tmp/skia_launcher ${APP_A
RGS[@]} & | 68 $ADB shell /data/local/tmp/gdbserver :5039 /data/local/tmp/skia_launcher ${APP_A
RGS[@]} & |
| OLD | NEW |