[Android] gdb: remove --apk-file option

Thomas Guillem git at videolan.org
Mon Aug 22 16:19:36 CEST 2016


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Aug 22 16:17:11 2016 +0200| [78ae4f773b1010fc5f8776ecc073a6ce553d178f] | committer: Thomas Guillem

gdb: remove --apk-file option

Use ndk-stack instead

Example:
$ adb logcat | $ANDROID_NDK/ndk-stack -sym .dbg/armeabi-v7a/2.1.0
$ $ANDROID_NDK/ndk-stack -sym .dbg/armeabi-v7a/2.1.0 -dump crash.txt

> https://code.videolan.org/videolan/vlc-android/commit/78ae4f773b1010fc5f8776ecc073a6ce553d178f
---

 compile-libvlc.sh |  8 +-------
 gdb.sh            | 42 ------------------------------------------
 2 files changed, 1 insertion(+), 49 deletions(-)

diff --git a/compile-libvlc.sh b/compile-libvlc.sh
index 592f6bc..73605de 100755
--- a/compile-libvlc.sh
+++ b/compile-libvlc.sh
@@ -694,16 +694,10 @@ if [ "${HAVE_LIBCOMPAT}" = "1" ];then
 fi
 
 DBG_LIB_DIR=libvlc/jni/obj/local/${ANDROID_ABI}
-OUT_LIB_DIR=libvlc/jni/libs/${ANDROID_ABI}
 VERSION=$(grep "android:versionName" vlc-android/AndroidManifest.xml|cut -d\" -f 2)
 OUT_DBG_DIR=.dbg/${ANDROID_ABI}/$VERSION
 
 echo "Dumping dbg symbols info ${OUT_DBG_DIR}"
 
 mkdir -p $OUT_DBG_DIR
-for lib in ${DBG_LIB_DIR}/*.so; do
-    ${CROSS_COMPILE}objcopy --only-keep-debug "$lib" "$OUT_DBG_DIR/`basename $lib.dbg`"; \
-done
-for lib in ${OUT_LIB_DIR}/*.so; do
-    ${CROSS_COMPILE}objcopy --add-gnu-debuglink="$OUT_DBG_DIR/`basename $lib.dbg`" "$lib" ; \
-done
+cp -a ${DBG_LIB_DIR}/*.so ${OUT_DBG_DIR}
diff --git a/gdb.sh b/gdb.sh
index b1f71f6..662c5d0 100755
--- a/gdb.sh
+++ b/gdb.sh
@@ -10,7 +10,6 @@ while [ $# -gt 0 ]; do
     case $1 in
         help|--help|-h)
             echo "Use -f to set the flavour. Default is vanillaARMv7."
-            echo "Use --apk-file <file.apk> [--dbg-file <file.so.dbg>] to debug an apk via a file containing the debugging info"
             exit 0
             ;;
         -f)
@@ -20,14 +19,6 @@ while [ $# -gt 0 ]; do
         -s)
             NDK_GDB_ARGS="$NDK_GDB_ARGS --nowait --start"
             ;;
-        --apk-file)
-            APK_PATH=$2
-            shift
-            ;;
-        --dbg-file)
-            DBGFILE_PATH=$2
-            shift
-            ;;
     esac
     shift
 done
@@ -35,39 +26,6 @@ done
 rm -rf "$TMP_PATH"
 mkdir -p "$TMP_PATH"
 
-if [ ! -z "$APK_PATH" ]; then
-    if [ ! -f "$APK_PATH" ];then
-        echo "invalid --apk"
-        exit 1
-    fi
-
-    aapt=$(ls -1 --sort=time $ANDROID_SDK/build-tools/*/aapt|head -n 1)
-    if [ -z "$aapt" ];then
-        echo "aapt not found in \$ANDROID_SDK"
-        exit 1
-    fi
-
-    arch=$($aapt l -a "$APK_PATH"|grep "libvlc.so"|cut -d"/" -f 2)
-
-    if [ -z "$DBGFILE_PATH" ];then
-        version=$($aapt l -a "$APK_PATH"|grep versionName|cut -d\" -f 2)
-        dbgfile_path="$SCRIPT_PATH/.dbg/$arch/$version/libvlc.so.dbg"
-    else
-        dbgfile_path="$DBGFILE_PATH"
-    fi
-    if [ ! -f "$dbgfile_path" ];then
-        echo "invalid --dbg-file"
-        exit 1
-    fi
-
-    echo ""
-    echo "\"list *0x<pc_address>\" to know where the specified apk crashed"
-    echo ""
-
-    ${ANDROID_NDK}/prebuilt/linux-x86_64/bin/gdb "$dbgfile_path"
-    exit 0
-fi
-
 ANDROID_MANIFEST="$SCRIPT_PATH"/vlc-android/build/intermediates/manifests/full/$FLAVOUR/debug/AndroidManifest.xml
 
 if [ ! -f "$ANDROID_MANIFEST" ]; then



More information about the Android mailing list