エクリプス/シグウィン
NDK 8c
共有ライブラリの構築
armeabi-v7a に切り替えた後、gdbserver を起動できなくなりました。オンラインで何時間も検索しましたが、特に armeabi-v7a のデバッグの問題を扱っているトピックが見つかりません。
armeabi-v7a に依存するサードパーティのライブラリを使用しているため、armeabi-v7a に切り替える選択肢がありません。それがないと、次のようなエラーが発生します。
D:\TEMP\ccnnGAqD.s:10427: Error: selected processor does not support Thumb mode `ldrex r6,[r3]'
D:\TEMP\ccnnGAqD.s:10429: Error: selected processor does not support Thumb mode `strex r4,r5,[r3]'
このセットアップを使用して、「armeabi」を使用する前はすべて正常に機能していました。
私が行った唯一の変更は、これを Application.mk に追加することです。
APP_ABI := armeabi-v7a
共有ライブラリ Android.mk の一番下に、これを追加しました。
$(info TARGET_ARCH = $(TARGET_ARCH))
$(info TARGET_ARCH_ABI = $(TARGET_ARCH_ABI))
$(info TARGET_ABI = $(TARGET_ABI))
以下を出力します。
TARGET_ARCH = arm
TARGET_ARCH_ABI = armeabi-v7a
TARGET_ABI = android-14-armeabi-v7a
を使用してアプリをアンインストールしました
adb uninstall com.example.game
AndroidManifest.xml には android:debuggable="true" プロパティがあります。
Eclipse で「すべて消去」を実行し、./libs および ./obj フォルダーを手動で削除しました。次に、ndk-build は正しいフォルダー (obj/local/armeabi-v7a および libs/armeabi-v7a) に出力し、obj/local/armeabi および libs/armeabiは存在しません。
ただし、ndk-gdb を実行すると次のようになります。
user@MACHINENAME /cygdrive/e/projects/game
$ ndk-gdb-eclipse --force --verbose
Android NDK installation path: /cygdrive/e/projects/sdks/android-ndk
Using default adb command: /cygdrive/e/projects/sdks/android-sdk/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.31
Using ADB flags:
Using auto-detected project path: .
Found package name: com.example.game
ABIs targetted by application: armeabi
Device API Level: 15
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Using gdb setup init: ./libs/armeabi/gdb.setup
Using toolchain prefix: /cygdrive/e/projects/sdks/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-
Using app out directory: ./obj/local/armeabi
Found debuggable flag: true
ERROR: Could not find gdbserver binary under ./libs/armeabi
This usually means you modified your AndroidManifest.xml to set
the android:debuggable flag to 'true' but did not rebuild the
native binaries. Please call 'ndk-build' to do so,
*then* re-install to the device!
間違った「armeabi」を使用している「ABIs targetted by application」に注意してください。ndk-gdb の関連部分は次のとおりです。
get_build_var ()
{
if [ -z "$GNUMAKE" ] ; then
GNUMAKE=make
fi
$GNUMAKE --no-print-dir -f $ANDROID_NDK_ROOT/build/core/build-local.mk -C $PROJECT DUMP_$1 | tail -1
}
APP_ABIS=`get_build_var APP_ABI`
if [ "$APP_ABIS" != "${APP_ABIS%%all*}" ] ; then
# replace first "all" with all available ABIs
ALL_ABIS=`get_build_var NDK_ALL_ABIS`
APP_ABIS_FRONT="${APP_ABIS%%all*}"
APP_ABIS_BACK="${APP_ABIS#*all}"
APP_ABIS="${APP_ABIS_FRONT}${ALL_ABIS}${APP_ABIS_BACK}"
fi
log "ABIs targetted by application: $APP_ABIS"
Application.mk で明らかに APP_ABI を armeabi-v7a に設定していますが、これは NDK のバグですか? または、何か不足していますか?