aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-06-03 11:57:49 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-04 10:56:51 -0700
commit54be48689b90488cb570f3393ef53e1b9e3d4e6a (patch)
tree1639218ed51a98c773372cb4d7e86e8dd8d53f3a
parentf2f883c9f5d1057b585f2490ffb12800d166e9f4 (diff)
downloadndk-54be48689b90488cb570f3393ef53e1b9e3d4e6a.tar.gz
ndk-gdb: fix to work properly with OS X's BSD awk
"gensub()" is a GNUAwk-ism that should not be used. Change-Id: I2df89efc165c84034594b98327921f9461188a76
-rw-r--r--build/awk/extract-pid.awk11
-rw-r--r--docs/CHANGES.TXT3
-rwxr-xr-xndk-gdb1
3 files changed, 12 insertions, 3 deletions
diff --git a/build/awk/extract-pid.awk b/build/awk/extract-pid.awk
index d646af71d..9a5677c62 100644
--- a/build/awk/extract-pid.awk
+++ b/build/awk/extract-pid.awk
@@ -30,13 +30,20 @@ BEGIN {
PID=0
FS=" "
# Need to escape the dots in the package name
- REGEX=gensub("\\.","\\\\.","g",PACKAGE)
+ #
+ # The first argument is the regular expression '\.'
+ # corresponding to a single dot character. The second
+ # argument is the replacement string, which will be '\.'
+ # for every input dot. Finally, we need to escape each
+ # backslash in the Awk strings.
+ #
+ gsub("\\.","\\.",PACKAGE)
}
# We use the fact that the 9th column of the 'ps' output
# contains the package name, while the 2nd one contains the pid
#
-$9 ~ REGEX {
+$9 ~ PACKAGE {
PID=$2
}
diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT
index 949d3e078..f6669b2d3 100644
--- a/docs/CHANGES.TXT
+++ b/docs/CHANGES.TXT
@@ -12,7 +12,8 @@ OTHER FIXES & CHANGES:
- ndk-gdb: check the target device's API level, and dump an error message if
it is not at least 8 (Android 2.2 a.k.a. Froyo). Fix script to properly
- remove control characters like '\r' from adb shell's output.
+ remove control characters like '\r' from adb shell's output. Also fix
+ script to work properly with OS X's BSD awk.
- ndk-build: Make AndroidManifest.xml optional. Now the build scripts will try
to look for jni/Android.mk if no manifest is found. If you don't use this,
diff --git a/ndk-gdb b/ndk-gdb
index 627129026..3cd7be4ae 100755
--- a/ndk-gdb
+++ b/ndk-gdb
@@ -340,6 +340,7 @@ if [ $? != 0 -o -z "$API_LEVEL" ] ; then
echo "ndk-gdb will only work if your device is running Android 2.2 or higher."
exit 1
fi
+log "Device API Level: $API_LEVEL"
if [ "$API_LEVEL" -lt "8" ] ; then
echo "ERROR: ndk-gdb requires a target device running Android 2.2 (API level 8) or higher."
echo "The target device is running API level $API_LEVEL !"