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 APP_NAME=$(basename $1) | 6 source $SCRIPT_DIR/android_setup.sh |
| 7 |
| 8 APP_NAME=${APP_ARGS[0]} |
7 PORT=5039 | 9 PORT=5039 |
8 | 10 |
9 # Collect extra arguments to be passed to the Skia binary | |
10 shift | |
11 while (( "$#" )); do | |
12 APP_ARGS="$APP_ARGS $1" | |
13 shift | |
14 done | |
15 | |
16 source $SCRIPT_DIR/android_setup.sh | |
17 source $SCRIPT_DIR/utils/setup_adb.sh | 11 source $SCRIPT_DIR/utils/setup_adb.sh |
18 | 12 |
19 # We need the debug symbols from these files | 13 # We need the debug symbols from these files |
20 GDB_TMP_DIR=$(pwd)/android_gdb_tmp | 14 GDB_TMP_DIR=$(pwd)/android_gdb_tmp |
21 mkdir $GDB_TMP_DIR | 15 mkdir $GDB_TMP_DIR |
22 echo "Copying symbol files" | 16 echo "Copying symbol files" |
23 adb_pull_if_needed /system/bin/skia_launcher $GDB_TMP_DIR | 17 adb_pull_if_needed /system/bin/skia_launcher $GDB_TMP_DIR |
24 adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR | 18 adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR |
25 adb_pull_if_needed /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR | 19 adb_pull_if_needed /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR |
26 adb_pull_if_needed /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR | 20 adb_pull_if_needed /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR |
(...skipping 20 matching lines...) Expand all Loading... |
47 | 41 |
48 echo "Setting up port forward" | 42 echo "Setting up port forward" |
49 $ADB forward "tcp:5039" "tcp:5039" | 43 $ADB forward "tcp:5039" "tcp:5039" |
50 | 44 |
51 # Kill all previous instances of gdbserver and skia_launcher to rid all port ove
rriding errors. | 45 # Kill all previous instances of gdbserver and skia_launcher to rid all port ove
rriding errors. |
52 echo "Killing any running Skia processes." | 46 echo "Killing any running Skia processes." |
53 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill | 47 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill |
54 $ADB shell ps | grep skia_launcher | awk '{print $2}' | xargs $ADB shell kill | 48 $ADB shell ps | grep skia_launcher | awk '{print $2}' | xargs $ADB shell kill |
55 | 49 |
56 # Starting up gdbserver in android shell | 50 # Starting up gdbserver in android shell |
57 echo "Starting gdbserver with command: skia_launcher $APP_NAME$APP_ARGS" | 51 echo "Starting gdbserver with command: skia_launcher $APP_ARGS" |
58 $ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_NAME$APP_ARGS & | 52 $ADB shell gdbserver :5039 /system/bin/skia_launcher $APP_ARGS & |
OLD | NEW |