| 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 source $SCRIPT_DIR/android_setup.sh | 6 source $SCRIPT_DIR/android_setup.sh |
| 7 | 7 |
| 8 # setup the gdbserver | 8 # setup the gdbserver |
| 9 $SCRIPT_DIR/android_gdbserver -d ${DEVICE_ID} ${APP_ARGS} | 9 $SCRIPT_DIR/android_gdbserver -d ${DEVICE_ID} ${APP_ARGS[@]} |
| 10 | 10 |
| 11 # quit if gdbserver setup failed | 11 # quit if gdbserver setup failed |
| 12 if [[ "$?" != "0" ]]; then | 12 if [[ "$?" != "0" ]]; then |
| 13 echo "ERROR: gdbserver failed to setup properly." | 13 echo "ERROR: gdbserver failed to setup properly." |
| 14 exit 1 | 14 exit 1 |
| 15 fi | 15 fi |
| 16 | 16 |
| 17 # Wait for gdbserver | 17 # Wait for gdbserver |
| 18 sleep 2 | 18 sleep 2 |
| 19 | 19 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 echo "Entering gdb client shell" | 38 echo "Entering gdb client shell" |
| 39 if [ "$ANDROID_ARCH" == "x86" ] | 39 if [ "$ANDROID_ARCH" == "x86" ] |
| 40 then | 40 then |
| 41 $ANDROID_TOOLCHAIN/i686-linux-android-gdb -x $GDBSETUP | 41 $ANDROID_TOOLCHAIN/i686-linux-android-gdb -x $GDBSETUP |
| 42 else | 42 else |
| 43 $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP | 43 $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP |
| 44 fi | 44 fi |
| 45 | 45 |
| 46 # Clean up | 46 # Clean up |
| 47 rm -rf $GDB_TMP_DIR | 47 rm -rf $GDB_TMP_DIR |
| OLD | NEW |