OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_gdb: Pushes gdbserver. Connects and enters debugging environment. | 3 # android_gdb: Pushes gdbserver. Connects and enters 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 APP_NAME=$(basename $1) |
7 PORT=5039 | 7 PORT=5039 |
8 | 8 |
9 # Collect extra arguments to be passed to the Skia binary | 9 # Collect extra arguments to be passed to the Skia binary |
10 shift | 10 shift |
11 while (( "$#" )); do | 11 while (( "$#" )); do |
12 APP_ARGS="$APP_ARGS $1" | 12 APP_ARGS="$APP_ARGS $1" |
13 shift | 13 shift |
14 done | 14 done |
15 | 15 |
16 source $SCRIPT_DIR/android_setup.sh | 16 source $SCRIPT_DIR/android_setup.sh |
17 source $SCRIPT_DIR/utils/setup_adb.sh | 17 source $SCRIPT_DIR/utils/setup_adb.sh |
18 | 18 |
19 # We need the debug symbols from these files | 19 # We need the debug symbols from these files |
20 GDB_TMP_DIR=$(pwd)/android_gdb_tmp | 20 GDB_TMP_DIR=$(pwd)/android_gdb_tmp |
21 mkdir $GDB_TMP_DIR | 21 mkdir $GDB_TMP_DIR |
22 echo "Copying symbol files" | 22 echo "Copying symbol files" |
23 $ADB pull /system/bin/skia_launcher $GDB_TMP_DIR | 23 $ADB pull /system/bin/skia_launcher $GDB_TMP_DIR |
24 $ADB pull /system/lib/libc.so $GDB_TMP_DIR | 24 $ADB pull /system/lib/libc.so $GDB_TMP_DIR |
| 25 $ADB pull /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR |
25 $ADB pull /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR | 26 $ADB pull /data/data/com.skia/lib/lib$APP_NAME.so $GDB_TMP_DIR |
26 | 27 |
27 echo "Checking for skia_launcher app..." | 28 echo "Checking for skia_launcher app..." |
28 if [ ! -f $GDB_TMP_DIR/skia_launcher ] | 29 if [ ! -f $GDB_TMP_DIR/skia_launcher ] |
29 then | 30 then |
30 echo "Unable for find the skia_launcher on the device" | 31 echo "Unable for find the skia_launcher on the device" |
31 rm -rf $GDB_TMP_DIR | 32 rm -rf $GDB_TMP_DIR |
32 exit 1; | 33 exit 1; |
33 fi | 34 fi |
34 | 35 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 echo "continue" >> $GDBSETUP | 72 echo "continue" >> $GDBSETUP |
72 echo "sharedLibrary $APP_NAME" >> $GDBSETUP | 73 echo "sharedLibrary $APP_NAME" >> $GDBSETUP |
73 | 74 |
74 | 75 |
75 # Launch gdb client | 76 # Launch gdb client |
76 echo "Entering gdb client shell" | 77 echo "Entering gdb client shell" |
77 $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP | 78 $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP |
78 | 79 |
79 # Clean up | 80 # Clean up |
80 rm -rf $GDB_TMP_DIR | 81 rm -rf $GDB_TMP_DIR |
OLD | NEW |