Skip to content

Instantly share code, notes, and snippets.

@splhack
Created July 15, 2009 06:36
Show Gist options
  • Save splhack/147523 to your computer and use it in GitHub Desktop.
Save splhack/147523 to your computer and use it in GitHub Desktop.
diff --git a/envsetup.sh b/envsetup.sh
index f8f20ab..c54c1d5 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -704,26 +704,26 @@ function gdbclient()
local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
- local EXE="$1"
+ local EXE="$2"
if [ "$EXE" ] ; then
- EXE=$1
+ EXE=$2
else
EXE="app_process"
fi
- local PORT="$2"
+ local PORT="$3"
if [ "$PORT" ] ; then
- PORT=$2
+ PORT=$3
else
PORT=":5039"
fi
local PID
- local PROG="$3"
+ local PROG="$1"
if [ "$PROG" ] ; then
- PID=`pid $3`
+ PID=$1
adb forward "tcp$PORT" "tcp$PORT"
- adb shell gdbserver $PORT --attach $PID &
+ adb shell su -c gdbserver $PORT --attach $PID &
sleep 2
else
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment