Get NDK debugging working from script: './apple2ix debug'

This commit is contained in:
Aaron Culliney 2015-11-10 22:08:32 -08:00
parent e4c669f016
commit ad5a6e8061
2 changed files with 26 additions and 30 deletions

View File

@ -38,7 +38,11 @@ endif
ifeq ($(EMBEDDED_STACKWALKER),1) ifeq ($(EMBEDDED_STACKWALKER),1)
LOCAL_CPPFLAGS += -DEMBEDDED_STACKWALKER=1 LOCAL_CPPFLAGS += -DEMBEDDED_STACKWALKER=1
else else
$(error OOPS, for now you should build with EMBEDDED_STACKWALKER=1) ifeq ($(RUNNING_GDB),1)
# nothing to do
else
$(error OOPS, for now you should build with EMBEDDED_STACKWALKER=1)
endif
endif endif
LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC) $(APPLE2_AUDIO_SRC) LOCAL_SRC_FILES += $(APPLE2_MAIN_SRC) $(APPLE2_META_SRC) $(APPLE2_VIDEO_SRC) $(APPLE2_AUDIO_SRC)
@ -49,5 +53,9 @@ include $(BUILD_SHARED_LIBRARY)
# --OR-- Build an executable so native can drive this show # --OR-- Build an executable so native can drive this show
#include $(BUILD_EXECUTABLE) #include $(BUILD_EXECUTABLE)
$(call import-module, breakpad/android/google_breakpad) ifeq ($(RUNNING_GDB),1)
# nothing to do
else
$(call import-module, breakpad/android/google_breakpad)
endif
$(call import-module, android/cpufeatures) $(call import-module, android/cpufeatures)

View File

@ -3,10 +3,18 @@
package_id="org.deadc0de.apple2ix.basic" package_id="org.deadc0de.apple2ix.basic"
apple2_src_path=apple2ix-src apple2_src_path=apple2ix-src
glue_srcs="$apple2_src_path/disk.c $apple2_src_path/misc.c $apple2_src_path/display.c $apple2_src_path/vm.c $apple2_src_path/cpu-supp.c $apple2_src_path/audio/speaker.c $apple2_src_path/audio/mockingboard.c" glue_srcs="$apple2_src_path/disk.c $apple2_src_path/misc.c $apple2_src_path/display.c $apple2_src_path/vm.c $apple2_src_path/cpu-supp.c $apple2_src_path/audio/speaker.c $apple2_src_path/audio/mockingboard.c"
target_arch=armeabi-v7a
usage() { usage() {
echo "$0 [--build-release] [--load] [--debug] [--armeabi | --armeabi-v7a]" if test "$(basename $0)" = "clean" ; then
echo "$0"
echo " # cleans NDK build of $package_id"
elif test "$(basename $0)" = "uninstall" ; then
echo "$0"
echo " # uninstalls $package_id"
else
echo "$0 [build] [load|debug]"
echo " # default builds $package_id and then load or debug"
fi
exit 0 exit 0
} }
@ -14,26 +22,14 @@ export EMBEDDED_STACKWALKER=1
while test "x$1" != "x"; do while test "x$1" != "x"; do
case "$1" in case "$1" in
"--debug") "debug")
do_debug=1 do_debug=1
;; ;;
"--load") "load")
do_load=1 do_load=1
;; ;;
"--armeabi")
target_arch=armeabi
;;
"--v7a")
target_arch=armeabi-v7a
;;
"--build-release")
do_release=1
;;
"-h") "-h")
usage usage
;; ;;
@ -43,7 +39,7 @@ while test "x$1" != "x"; do
;; ;;
*) *)
package_id=$1 usage
;; ;;
esac esac
shift shift
@ -108,11 +104,7 @@ fi
############################################################################### ###############################################################################
# build native sources # build native sources
if test "x$do_release" = "x1" ; then ndk-build V=1 NDK_MODULE_PATH=. NDK_DEBUG=1 # NDK_TOOLCHAIN_VERSION=clang
ndk-build V=1 NDK_MODULE_PATH=. # NDK_TOOLCHAIN_VERSION=clang
else
ndk-build V=1 NDK_MODULE_PATH=. NDK_DEBUG=1 # NDK_TOOLCHAIN_VERSION=clang
fi
ret=$? ret=$?
if test "x$ret" != "x0" ; then if test "x$ret" != "x0" ; then
exit $ret exit $ret
@ -179,13 +171,9 @@ fi
############################################################################### ###############################################################################
if test "x$do_debug" = "x1" ; then if test "x$do_debug" = "x1" ; then
export RUNNING_GDB=1
cd .. cd ..
/bin/rm ./libs/gdbserver ndk-gdb --nowait --force --verbose --launch=org.deadc0de.apple2ix.Apple2Activity
/bin/ln -s $target_arch/gdbserver libs/gdbserver
##/bin/rm ./libs/gdb.setup
##/bin/ln -s $target_arch/gdb.setup libs/gdb.setup
##ndk-gdb --verbose --force --launch=org.deadc0de.apple2ix.Apple2Activity
ndk-gdb --nowait --verbose --force --launch=org.deadc0de.apple2ix.Apple2Activity
elif test "x$do_load" = "x1" ; then elif test "x$do_load" = "x1" ; then
adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2ix.basic/org.deadc0de.apple2ix.Apple2Activity adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2ix.basic/org.deadc0de.apple2ix.Apple2Activity
fi fi