Enable gdbclient to accept both name and pid of the process

Change-Id: I10234ddb2e52de302818e1b5b27a8f35651c4395
This commit is contained in:
Grace Kloba 2011-04-30 11:04:05 -07:00
parent 76ace42ca2
commit e9d04bf88b
1 changed files with 5 additions and 1 deletions

View File

@ -785,7 +785,11 @@ function gdbclient()
local PID
local PROG="$3"
if [ "$PROG" ] ; then
PID=`pid $3`
if [[ "$PROG" =~ ^[0-9]+$ ]] ; then
PID="$3"
else
PID=`pid $3`
fi
adb forward "tcp$PORT" "tcp$PORT"
adb shell gdbserver $PORT --attach $PID &
sleep 2