adb_pull_if_needed /data/data/com.skia.sample_app/lib/libSampleApp.so $GDB_TMP_DIR
echo "Pushing gdbserver..."
-adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver /data/local/tmp
+adb_push_if_needed $ANDROID_TOOLCHAIN/gdbserver /data/local/tmp
# Launch the app
echo "Launching the app..."
# Launch gdb client
echo "Entering gdb client shell"
-GDB_COMMAND=$(command ls "$ANDROID_TOOLCHAIN"/*-gdb | head -n1)
+GDB_COMMAND=$(command ls "$ANDROID_TOOLCHAIN"/bin/*-gdb | head -n1)
"$GDB_COMMAND" -x $GDBSETUP
# Clean up:
# Launch gdb client
echo "Entering gdb client shell"
-$ANDROID_TOOLCHAIN/../host_prebuilt/bin/gdb -x $GDBSETUP
+$ANDROID_TOOLCHAIN/host_prebuilt/bin/gdb -x $GDBSETUP
# Clean up:
# We could 'rm -rf $GDB_TMP_DIR', but doing so would cause subsequent debugging
done
echo "Pushing gdbserver..."
-adb_push_if_needed $ANDROID_TOOLCHAIN/../gdbserver /data/local/tmp
+adb_push_if_needed $ANDROID_TOOLCHAIN/gdbserver /data/local/tmp
echo "Setting up port forward"
$ADB forward "tcp:5039" "tcp:5039"
TOOLCHAIN=$ANDROID_ARCH-$NDK-$API
HOST=`uname | tr '[A-Z]' '[a-z]'`
- exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}/bin"
+ exportVar ANDROID_TOOLCHAIN "${TOOLCHAINS}/${TOOLCHAIN}"
if [ ! -d "$ANDROID_TOOLCHAIN" ]; then
mkdir -p $TOOLCHAINS
fi
fi
-GCC=$(command ls $ANDROID_TOOLCHAIN/*-gcc | head -n1)
+GCC=$(command ls $ANDROID_TOOLCHAIN/bin/*-gcc | head -n1)
if [ -z "$GCC" ]; then
- echo "ERROR: Could not find Android cross-compiler in: $ANDROID_TOOLCHAIN"
+ echo "ERROR: Could not find Android cross-compiler in: ${ANDROID_TOOLCHAIN}/bin"
return 1
fi
ln -sf $ANDROID_TOOLCHAIN_PREFIX-as $ANDROID_TOOLCHAIN/as
fi
-exportVar PATH $ANDROID_TOOLCHAIN:$PATH
+exportVar PATH ${ANDROID_TOOLCHAIN}/bin:${PATH}