| OLD | NEW | 
|---|
| 1 #!/bin/bash | 1 #!/bin/bash | 
| 2 # | 2 # | 
| 3 # android_gdbserver: Pushes gdbserver. Starts debugging environment. | 3 # android_gdbserver: Pushes gdbserver. Starts 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 source $SCRIPT_DIR/utils/setup_adb.sh | 7 source $SCRIPT_DIR/utils/setup_adb.sh | 
| 8 | 8 | 
| 9 APP_NAME=${APP_ARGS[0]} | 9 APP_NAME=${APP_ARGS[0]} | 
| 10 PORT=5039 | 10 PORT=5039 | 
| 11 | 11 | 
| 12 BUILD_DIR="${SKIA_OUT}/${BUILDTYPE}" | 12 BUILD_DIR="${SKIA_OUT}/${BUILDTYPE}" | 
| 13 TARGET_LIBRARY="${BUILD_DIR}/lib/lib${APP_NAME}.so" | 13 TARGET_LIBRARY="${BUILD_DIR}/lib/lib${APP_NAME}.so" | 
| 14 if [ ! -f "$TARGET_LIBRARY" ] | 14 if [ ! -f "$TARGET_LIBRARY" ] | 
| 15 then | 15 then | 
| 16   echo "Unable to find the ${APP_NAME} library at ${TARGET_LIBRARY}." | 16   echo "Unable to find the ${APP_NAME} library at ${TARGET_LIBRARY}." | 
| 17   exit 1 | 17   exit 1 | 
| 18 fi | 18 fi | 
| 19 | 19 | 
| 20 # We need the debug symbols from these files | 20 # We need the debug symbols from these files | 
| 21 GDB_TMP_DIR=$(pwd)/android_gdb_tmp | 21 GDB_TMP_DIR=$SKIA_OUT/android_gdb_tmp | 
| 22 mkdir -p $GDB_TMP_DIR | 22 mkdir -p $GDB_TMP_DIR | 
| 23 | 23 | 
| 24 echo "Copying symbol files" | 24 echo "Copying symbol files" | 
| 25 if [[ $ANDROID_ARCH == *64* ]]; then | 25 if [[ $ANDROID_ARCH == *64* ]]; then | 
| 26   SYSTEM_LIBRARY_PATH=/system/lib64 | 26   SYSTEM_LIBRARY_PATH=/system/lib64 | 
| 27 else | 27 else | 
| 28   SYSTEM_LIBRARY_PATH=/system/lib | 28   SYSTEM_LIBRARY_PATH=/system/lib | 
| 29 fi | 29 fi | 
| 30 for library_file in \ | 30 for library_file in \ | 
| 31     libc.so \ | 31     libc.so \ | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 75 $ADB forward "tcp:5039" "tcp:5039" | 75 $ADB forward "tcp:5039" "tcp:5039" | 
| 76 | 76 | 
| 77 # Kill all previous instances of gdbserver and the app to rid all port overridin
    g errors. | 77 # Kill all previous instances of gdbserver and the app to rid all port overridin
    g errors. | 
| 78 echo "Killing any running Skia processes." | 78 echo "Killing any running Skia processes." | 
| 79 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill | 79 $ADB shell ps | grep gdbserver | awk '{print $2}' | xargs $ADB shell kill | 
| 80 $ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill | 80 $ADB shell ps | grep ${APP_NAME} | awk '{print $2}' | xargs $ADB shell kill | 
| 81 | 81 | 
| 82 # Starting up gdbserver in android shell | 82 # Starting up gdbserver in android shell | 
| 83 echo "Starting gdbserver with command: ${APP_ARGS[@]}" | 83 echo "Starting gdbserver with command: ${APP_ARGS[@]}" | 
| 84 $ADB shell LD_LIBRARY_PATH=/data/local/tmp:\$LD_LIBRARY_PATH /data/local/tmp/gdb
    server :5039 /data/local/tmp/skia_launcher ${APP_ARGS[@]} & | 84 $ADB shell LD_LIBRARY_PATH=/data/local/tmp:\$LD_LIBRARY_PATH /data/local/tmp/gdb
    server :5039 /data/local/tmp/skia_launcher ${APP_ARGS[@]} & | 
| OLD | NEW | 
|---|