| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # android_gdb: Pushes parameter binary and gdbserver. Connects | 3 # android_gdb: Pushes parameter binary and gdbserver. Connects |
| 4 # and enters debugging environment. | 4 # and enters debugging environment. |
| 5 | 5 |
| 6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 7 source $SCRIPT_DIR/android_setup.sh | 7 source $SCRIPT_DIR/android_setup.sh |
| 8 | 8 |
| 9 APP_NAME=${APP_ARGS[0]} | 9 APP_NAME=${APP_ARGS[0]} |
| 10 PORT=5039 | 10 PORT=5039 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 # Set up gdb commands | 46 # Set up gdb commands |
| 47 GDBSETUP=$GDB_TMP_DIR/gdb.setup | 47 GDBSETUP=$GDB_TMP_DIR/gdb.setup |
| 48 echo "file $GDB_TMP_DIR/app_process" >> $GDBSETUP | 48 echo "file $GDB_TMP_DIR/app_process" >> $GDBSETUP |
| 49 echo "target remote :$PORT" >> $GDBSETUP | 49 echo "target remote :$PORT" >> $GDBSETUP |
| 50 echo "set solib-absolute-prefix $GDB_TMP_DIR" >> $GDBSETUP | 50 echo "set solib-absolute-prefix $GDB_TMP_DIR" >> $GDBSETUP |
| 51 echo "set solib-search-path $GDB_TMP_DIR" >> $GDBSETUP | 51 echo "set solib-search-path $GDB_TMP_DIR" >> $GDBSETUP |
| 52 | 52 |
| 53 # Launch gdb client | 53 # Launch gdb client |
| 54 echo "Entering gdb client shell" | 54 echo "Entering gdb client shell" |
| 55 if [ "$ANDROID_ARCH" == "x86" ] | 55 GDB_COMMAND=$(command ls "$ANDROID_TOOLCHAIN"/*-gdb | head -n1) |
| 56 then | 56 "$GDB_COMMAND" -x $GDBSETUP |
| 57 $ANDROID_TOOLCHAIN/i686-linux-android-gdb -x $GDBSETUP | |
| 58 else | |
| 59 $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP | |
| 60 fi | |
| 61 | 57 |
| 62 # Clean up | 58 # Clean up |
| 63 rm -rf $GDB_TMP_DIR | 59 rm -rf $GDB_TMP_DIR |
| 64 | 60 |
| OLD | NEW |