Ticket #13322: 20180925_1334_gdb_fix.patch

File 20180925_1334_gdb_fix.patch, 1.4 KB (added by Peter Bennett, 9 months ago)

fix for gdb.sh

  • android/gdb.sh

    diff --git a/android/gdb.sh b/android/gdb.sh
    index 426d371..5e1ee47 100755
    a b if [ -z "$USE_IP" ] ; then USE_IP=0 ; fi 
    1414if [ -z "$TMPDIR" ] ; then TMPDIR=/data/local/tmp ; fi
    1515
    1616source make.inc
    17 
    18 if [ $ARM64 == 1 ]; then
     17if [ "$ARM64" == 1 ]; then
    1918        MYGDB="$ANDROID_NDK/my-android-toolchain64/bin/ndk-gdb"
    2019        BUILDDIR=build64
    2120        PROJDIR=mythinstall64
    fi 
    7574PACKAGE_NAME=org.mythtv.mythfrontend
    7675LAUNCH_ACTIVITY=org.qtproject.qt5.android.bindings.QtActivity
    7776START_WAIT=-D
    78 DATA_DIR=$(adb shell run-as $PACKAGE_NAME pwd)
     77DATA_DIR=$(adb shell run-as $PACKAGE_NAME sh -c pwd)
     78# remove carriage return at end
     79DATA_DIR=$(echo "$DATA_DIR" | sed 's/\s//g')
    7980DEVICE_GDBSERVER=$DATA_DIR/gdbserver
    8081DEBUG_SOCKET=$DATA_DIR/debug-socket
    8182
    82 if ! adb shell test -e $DEVICE_GDBSERVER ; then
     83rc=$(adb shell sh -c "test -e $DEVICE_GDBSERVER ; echo $?")
     84if [[ "$rc" != 0 ]] ; then
    8385        #adb shell mkdir -p $(dirname $DEVICE_GDBSERVER)
    8486        adb push ${ANDROID_NDK_ROOT}/prebuilt/android-${TARGET_ARCH}/gdbserver/gdbserver $TMPDIR
    8587        adb shell run-as $PACKAGE_NAME cp $TMPDIR/gdbserver $DEVICE_GDBSERVER
    8688        adb shell run-as $PACKAGE_NAME chmod a+x $DEVICE_GDBSERVER
    8789fi
    8890
    89 if ! adb shell test -e /system/bin/$APP_PROCESS_NAME ; then
     91rc=$(adb shell sh -c "test -e /system/bin/$APP_PROCESS_NAME ; echo $?")
     92if [[ $rc != 0 ]] ; then
    9093        APP_PROCESS_NAME=app_process
    9194fi
    9295adb pull /system/bin/$APP_PROCESS_NAME $sodir/$APP_PROCESS_NAME