diff options
author | Kai Backman <kaib@golang.org> | 2010-07-30 10:35:07 +0300 |
---|---|---|
committer | Kai Backman <kaib@golang.org> | 2010-07-30 10:35:07 +0300 |
commit | 4b9af92723c6ffa8f369816df5cf0e491078eba1 (patch) | |
tree | 00b3ce78e401c639aebb42d890ef72e9880d1ce7 /misc/arm | |
parent | d2ee8dda64d10714b3e525c32fb5e523d0bb9550 (diff) | |
download | go-4b9af92723c6ffa8f369816df5cf0e491078eba1.tar.gz |
arm: add gdb support to android launcher script
R=rsc
CC=golang-dev
http://codereview.appspot.com/1742050
Diffstat (limited to 'misc/arm')
-rwxr-xr-x | misc/arm/a | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/misc/arm/a b/misc/arm/a index 7d810a30f..701f4941f 100755 --- a/misc/arm/a +++ b/misc/arm/a @@ -39,11 +39,20 @@ echo RETVAL: $?' fi # run the main binary -if [ "$*" != "$1" ]; then - args=$(echo $*| cut -d' ' -f2-) +if [ "-g" == "$1" ]; then + adb forward tcp:$2 tcp:$2 + args=$(echo $*| cut -d' ' -f4-) + adb push $3 /data/local/tmp/$3 >/dev/null 2>&1 + adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \ + gdbserver :$2 /data/local/tmp/retval /data/local/tmp/$3 $args" \ + 2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL +else + if [ "$*" != "$1" ]; then + args=$(echo $*| cut -d' ' -f2-) + fi + adb push $1 /data/local/tmp/$1 >/dev/null 2>&1 + adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \ + /data/local/tmp/retval /data/local/tmp/$1 $args" \ + 2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL fi -adb push $1 /data/local/tmp/$1 >/dev/null 2>&1 -adb shell "$(exp GOARCH) $(exp GOTRACEBACK) $(exp GOGC) \ - /data/local/tmp/retval /data/local/tmp/$1 $args" \ - 2>&1|tr -d '\r' |tee /tmp/adb.out|grep -v RETVAL exit $(grep RETVAL /tmp/adb.out|tr -d '\n\r'| cut -d' ' -f2) |