make gdbclient work on x86

Change-Id: I2fd4fc2b89db13a8db1b177afdab593772cb12f8
This commit is contained in:
Nick Kralevich 2011-11-11 09:02:01 -08:00
parent ba2c734f71
commit 0ab21d3ed3
2 changed files with 16 additions and 2 deletions

View File

@ -5,11 +5,17 @@ ifeq ($(CALLED_FROM_SETUP),true)
ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES)
# Add the toolchain bin dir if it actually exists # Add the ARM toolchain bin dir if it actually exists
ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin),) ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin),)
# this should be copied to HOST_OUT_EXECUTABLES instead # this should be copied to HOST_OUT_EXECUTABLES instead
ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin
endif endif
# Add the x86 toolchain bin dir if it actually exists
ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-android-linux-4.4.3/bin),)
# this should be copied to HOST_OUT_EXECUTABLES instead
ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-android-linux-4.4.3/bin
endif
ANDROID_BUILD_PATHS := $(ABP) ANDROID_BUILD_PATHS := $(ABP)
ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)

View File

@ -704,6 +704,14 @@ function gdbclient()
local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED) local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED)
local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED) local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED)
local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS) local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS)
local ARCH=$(get_build_var TARGET_ARCH)
local GDB
case "$ARCH" in
x86) GDB=i686-android-linux-gdb;;
arm) GDB=arm-linux-androideabi-gdb;;
*) echo "Unknown arch $ARCH"; return 1;;
esac
if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then
local EXE="$1" local EXE="$1"
if [ "$EXE" ] ; then if [ "$EXE" ] ; then
@ -744,7 +752,7 @@ function gdbclient()
echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT" echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT"
echo >>"$OUT_ROOT/gdbclient.cmds" "" echo >>"$OUT_ROOT/gdbclient.cmds" ""
arm-linux-androideabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" $GDB -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE"
else else
echo "Unable to determine build system output dir." echo "Unable to determine build system output dir."
fi fi