 Chromium Code Reviews
 Chromium Code Reviews Issue 19920003:
  add debugging support for android on x86 phone  (Closed) 
  Base URL: http://skia.googlecode.com/svn/trunk/
    
  
    Issue 19920003:
  add debugging support for android on x86 phone  (Closed) 
  Base URL: http://skia.googlecode.com/svn/trunk/| Index: platform_tools/android/bin/android_gdb_exe | 
| =================================================================== | 
| --- platform_tools/android/bin/android_gdb_exe (revision 10224) | 
| +++ platform_tools/android/bin/android_gdb_exe (working copy) | 
| @@ -2,10 +2,30 @@ | 
| # | 
| # android_gdb: Pushes gdbserver. Connects and enters debugging environment. | 
| +deviceID="" | 
| +while (( "$#" )); do | 
| + | 
| + if [[ $(echo "$1" | grep "^-d$") != "" ]]; | 
| + then | 
| + deviceID="$2" | 
| + shift | 
| + else | 
| + gdbVars="${gdbVars[@]} $1" | 
| + fi | 
| + | 
| +shift | 
| +done | 
| + | 
| +# hack for x86 support in android_setup.sh | 
| +if [ "$deviceID" == "x86" ] || [ "$deviceID" == "razr_i" ] | 
| +then | 
| + ANDROID_ARCH=x86 | 
| +fi | 
| + | 
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 
| # setup the gdbserver | 
| -$SCRIPT_DIR/android_gdbserver $@ | 
| +source $SCRIPT_DIR/android_gdbserver ${gdbVars[@]} | 
| 
djsollen
2013/07/30 12:37:51
I would not source it.  Doing so could cause us to
 
yunchao
2013/07/31 02:11:53
If we don't source it, ANDROID_ARCH env parameter
 
djsollen
2013/07/31 13:45:06
I see what your saying, but you can also just expo
 
yunchao
2013/08/01 02:10:52
Yes, very good suggestion, djsollen. I have update
 | 
| # quit if gdbserver setup failed | 
| if [[ "$?" != "0" ]]; then | 
| @@ -18,7 +38,7 @@ | 
| # variables that must match those in gdb_server | 
| GDB_TMP_DIR=$(pwd)/android_gdb_tmp | 
| -APP_NAME=$(basename $1) | 
| +APP_NAME=$(basename ${gdbVars[0]}) | 
| PORT=5039 | 
| # Set up gdb commands | 
| @@ -37,7 +57,12 @@ | 
| # Launch gdb client | 
| echo "Entering gdb client shell" | 
| -$ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP | 
| +if [ "$ANDROID_ARCH" == "x86" ] | 
| +then | 
| + $ANDROID_TOOLCHAIN/i686-linux-android-gdb -x $GDBSETUP | 
| +else | 
| + $ANDROID_TOOLCHAIN/arm-linux-androideabi-gdb -x $GDBSETUP | 
| +fi | 
| # Clean up | 
| rm -rf $GDB_TMP_DIR |