OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # android_gdb: Pushes gdbserver. Connects and enters debugging environment. | 3 # android_gdb_native: Pushes gdbserver, connects to specified Skia app, |
4 # and enters command line debugging environment. | |
4 | 5 |
5 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 6 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
6 source $SCRIPT_DIR/android_setup.sh | 7 source $SCRIPT_DIR/android_setup.sh |
7 | 8 |
8 # setup the gdbserver | 9 # setup the gdbserver |
9 export BUILDTYPE # from android_setup.sh | 10 export BUILDTYPE # from android_setup.sh |
10 $SCRIPT_DIR/android_gdbserver -d ${DEVICE_ID} ${APP_ARGS[@]} | 11 $SCRIPT_DIR/android_gdbserver -d ${DEVICE_ID} ${APP_ARGS[@]} |
11 | 12 |
12 # quit if gdbserver setup failed | 13 # quit if gdbserver setup failed |
13 if [[ "$?" != "0" ]]; then | 14 if [[ "$?" != "0" ]]; then |
(...skipping 26 matching lines...) Expand all Loading... | |
40 # Load libskia_android.so here. | 41 # Load libskia_android.so here. |
41 echo "sharedLibrary skia_android" | 42 echo "sharedLibrary skia_android" |
42 } > $GDBSETUP | 43 } > $GDBSETUP |
43 | 44 |
44 | 45 |
45 # Launch gdb client | 46 # Launch gdb client |
46 echo "Entering gdb client shell" | 47 echo "Entering gdb client shell" |
47 GDB_COMMAND=$(command ls "$ANDROID_TOOLCHAIN"/*-gdb | head -n1) | 48 GDB_COMMAND=$(command ls "$ANDROID_TOOLCHAIN"/*-gdb | head -n1) |
48 "$GDB_COMMAND" -x $GDBSETUP | 49 "$GDB_COMMAND" -x $GDBSETUP |
49 | 50 |
50 # Clean up | 51 # Clean up: |
51 rm -rf $GDB_TMP_DIR | 52 # We could 'rm -rf $GDB_TMP_DIR', but doing so would cause subsequent debugging |
53 # sessions to take longer than necessary. The tradeoff is to now force the user | |
54 # to remove the directory when they are done debugging. | |
scroggo
2015/02/09 14:03:32
Any way for the user to know this? If it ever matt
djsollen
2015/02/10 13:47:20
I think it is more convenient to just rm -rf the d
| |
55 rm $GDBSETUP | |
OLD | NEW |