Fix 'debugging on Android' android_gdb_app script.

1) com.skia -> com.skia.sample_app
2) pass arguments to android_gdb_app to android_setup.sh so you can build gdbserver binaries for your actual device(rather than default arm64). This allows you to run it like this for example:

  ./platform_tools/android/bin/android_gdb_app -d nexus_6

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1509853006

Review URL: https://codereview.chromium.org/1509853006
This commit is contained in:
aam 2015-12-10 14:14:56 -08:00 committed by Commit bot
parent 30da5f7a1e
commit 419c37269f
2 changed files with 6 additions and 6 deletions

View File

@ -4,7 +4,7 @@
# the debugging environment.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/android_setup.sh
source $SCRIPT_DIR/android_setup.sh "$@"
APP_NAME=${APP_ARGS[0]}
PORT=5039
@ -31,21 +31,21 @@ mkdir -p $GDB_TMP_DIR
echo "Copying symbol files"
adb_pull_if_needed /system/bin/app_process $GDB_TMP_DIR
adb_pull_if_needed /system/lib/libc.so $GDB_TMP_DIR
adb_pull_if_needed /data/data/com.skia/lib/libskia_android.so $GDB_TMP_DIR
adb_pull_if_needed /data/data/com.skia/lib/libSampleApp.so $GDB_TMP_DIR
adb_pull_if_needed /data/data/com.skia.sample_app/lib/libskia_android.so $GDB_TMP_DIR
adb_pull_if_needed /data/data/com.skia.sample_app/lib/libSampleApp.so $GDB_TMP_DIR
echo "Pushing gdbserver..."
adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver /data/local/tmp
# Launch the app
echo "Launching the app..."
$ADB $DEVICE_SERIAL shell am start -n com.skia/com.skia.SkiaSampleActivity
$ADB $DEVICE_SERIAL shell am start -n com.skia.sample_app/com.skia.SkiaSampleActivity
# Wait for app process to initialize
sleep 2
# Attach gdbserver to the app process
PID=$($ADB shell ps | grep com.skia | awk '{print $2}')
PID=$($ADB shell ps | grep com.skia.sample_app | awk '{print $2}')
echo "Attaching to pid: $PID"
$ADB $DEVICE_SERIAL shell /data/local/tmp/gdbserver :$PORT --attach $PID &

View File

@ -201,7 +201,7 @@ Note: The debugging scripts do not build the app - you'll have to do that first.
# SAMPLE APP
# make sure you've installed the app on the device first
./platform_tools/android/bin/android_gdb_app
./platform_tools/android/bin/android_gdb_app [-d device_id]
When the gdb client is ready, insert a breakpoint, and continue to let the
program resume execution.