Symbolize script: make dash-compatible and pull vdex file for oatdump.
Make dash-compatible.
Check result on Linux 4.15.0-91-generic #92~16.04.1-Ubuntu is
shown as follows:
$ shellcheck -s sh art/tools/symbolize.sh
In art/tools/symbolize.sh line 29:
function one() {
^-- SC2112: 'function' keyword is non-standard. Delete it.
...
Pull out vdex file for oatdump command.
Test: bash symbolize.sh
Test: bash --posix symbolize.sh
Test: dash symbolize.sh
Change-Id: I7374b4f6ebd525ac064ac5505e88384eadd16255
diff --git a/tools/symbolize.sh b/tools/symbolize.sh
index f5686e6..2b6a5a1 100755
--- a/tools/symbolize.sh
+++ b/tools/symbolize.sh
@@ -26,7 +26,7 @@
fi
# Pull the file from the device and symbolize it.
-function one() {
+one() {
echo $1 $2
if [ "x$INTERACTIVE" = "xyes" ] ; then
echo -n "What to do? [Y/n/q] "
@@ -39,17 +39,20 @@
fi
fi
adb pull $1/$2 /tmp || exit 1
+ # pull vdex file for oatdump
+ vdex=${2%.*}.vdex
+ adb pull $1/$vdex /tmp/ 2>/dev/null
mkdir -p $OUT/symbols/$1
oatdump --symbolize=/tmp/$2 --output=$OUT/symbols/$1/$2
}
# adb shell find seems to output in DOS format (CRLF), which messes up scripting
-function adbshellstrip() {
+adbshellstrip() {
adb shell $@ | sed 's/\r$//'
}
# Search in all of /data on device.
-function all() {
+all() {
FILES=$(adbshellstrip find /data -name "'*.oat'" -o -name "'*.dex'" -o -name "'*.odex'")
for FILE in $FILES ; do
DIR=$(dirname $FILE)