05256f6811
R=djsollen@google.com, borenet@google.com Author: yunchao.he@intel.com Review URL: https://chromiumcodereview.appspot.com/20671002 git-svn-id: http://skia.googlecode.com/svn/trunk@10430 2bbb7eff-a529-9590-31e7-b0007b416f81
43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# android_gdb: Pushes gdbserver. Connects and enters debugging environment.
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
# setup the gdbserver
|
|
$SCRIPT_DIR/android_gdbserver $@
|
|
|
|
# quit if gdbserver setup failed
|
|
if [[ "$?" != "0" ]]; then
|
|
echo "ERROR: gdbserver failed to setup properly."
|
|
exit 1
|
|
fi
|
|
|
|
# Wait for gdbserver
|
|
sleep 2
|
|
|
|
# variables that must match those in gdb_server
|
|
GDB_TMP_DIR=$(pwd)/android_gdb_tmp
|
|
APP_NAME=$(basename $1)
|
|
PORT=5039
|
|
|
|
# Set up gdb commands
|
|
GDBSETUP=$GDB_TMP_DIR/gdb.setup
|
|
echo "file $GDB_TMP_DIR/skia_launcher" >> $GDBSETUP
|
|
echo "target remote :$PORT" >> $GDBSETUP
|
|
echo "set solib-absolute-prefix $GDB_TMP_DIR" >> $GDBSETUP
|
|
echo "set solib-search-path $GDB_TMP_DIR" >> $GDBSETUP
|
|
|
|
# The apps shared library symbols are not loaded by default so we load them here
|
|
echo "break launch_app" >> $GDBSETUP
|
|
echo "continue" >> $GDBSETUP
|
|
echo "sharedLibrary $APP_NAME" >> $GDBSETUP
|
|
|
|
source $SCRIPT_DIR/android_setup.sh
|
|
|
|
# Launch gdb client
|
|
echo "Entering gdb client shell"
|
|
$ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP
|
|
|
|
# Clean up
|
|
rm -rf $GDB_TMP_DIR |