[Android] libvlc: gdb: fix script

Thomas Guillem git at videolan.org
Wed Jan 29 15:50:33 CET 2020


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jan 29 15:29:47 2020 +0100| [87662b01a0972847b87fd1b4e606c682e85e98bb] | committer: Thomas Guillem

libvlc: gdb: fix script

- Fix the ANDROID_MANIFEST path (app/build instead of vlc-android/build).
- Remove useless copies (libs folder, Android.mk, whole obj/local/*/ when only
  the so are needed)
- Configure it only for the arch of the last built APK. This fixes armv7 builds
  that could not be debugged on armv8 arches.

> https://code.videolan.org/videolan/vlc-android/commit/87662b01a0972847b87fd1b4e606c682e85e98bb
---

 libvlc/gdb.sh | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/libvlc/gdb.sh b/libvlc/gdb.sh
index 32b6b414e..d72a0d6e2 100755
--- a/libvlc/gdb.sh
+++ b/libvlc/gdb.sh
@@ -16,25 +16,26 @@ done
 rm -rf "$TMP_PATH"
 mkdir -p "$TMP_PATH"
 
-ANDROID_MANIFEST="$SCRIPT_PATH/../vlc-android/build/intermediates/merged_manifests/dev/AndroidManifest.xml"
+APP_BUILD="$SCRIPT_PATH/../app/build/intermediates"
+ANDROID_MANIFEST="$APP_BUILD/merged_manifests/dev/AndroidManifest.xml"
+ABI=`ls "$APP_BUILD/stripped_native_libs/dev/out/lib" --sort=time | head -n 1`
 
-if [ ! -f "$ANDROID_MANIFEST" ]; then
-    echo "invalid manifest, did you try building first ?"
+if [ ! -f "$ANDROID_MANIFEST" -o "$ABI" = "" ]; then
+    echo "Invalid manifest/ABI, did you try building first ?"
     exit 1
 fi
 
 mkdir -p "$TMP_PATH"/jni
+touch "$TMP_PATH"/jni/Android.mk
+echo "APP_ABI := $ABI" > "$TMP_PATH"/jni/Application.mk
 
-cp -r "$SCRIPT_PATH"/../vlc/build-android-*linux-android*/ndk/libs $TMP_PATH
-cp -r "$SCRIPT_PATH"/../vlc/build-android-*linux-android*/ndk/obj $TMP_PATH
+DEST=obj/local/$ABI
+mkdir -p "$TMP_PATH/$DEST"
 
-cp -r "$SCRIPT_PATH"/../medialibrary/jni/libs "$TMP_PATH"
-cp -r "$SCRIPT_PATH"/../medialibrary/jni/obj "$TMP_PATH"
+cp -r "$SCRIPT_PATH"/../libvlc/jni/$DEST/*.so "$TMP_PATH/$DEST"
+cp -r "$SCRIPT_PATH"/../vlc/build-android-*linux-android*/ndk/$DEST/*.so "$TMP_PATH/$DEST"
+cp -r "$SCRIPT_PATH"/../medialibrary/jni/$DEST/*.so "$TMP_PATH/$DEST"
 
-ln -s "$TMP_PATH"/obj "$TMP_PATH"/jni
-
-cp "$SCRIPT_PATH"/jni/Android.mk "$TMP_PATH"/jni
-echo "APP_ABI := all" > "$TMP_PATH"/jni/Application.mk
 
 cp "$ANDROID_MANIFEST" "$TMP_PATH"
 



More information about the Android mailing list