Android NDK调试:armeabi-v7a无法正常工作

问题描述 投票:8回答:1

Eclipse / Cygwin

NDK 8c

构建共享库

切换到armeabi-v7a后,我无法启动gdbserver。我在网上搜索了几个小时,但找不到专门处理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'之前一切正常.http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/

我做的唯一更改是将其添加到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'注意“应用程序定位的ABYS”。这是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"

我清楚地将APP_ABI设置为Application.mk中的armeabi-v7a,这是NDK中的一个错误吗?或者我错过了什么?

android eclipse debugging android-ndk cygwin
1个回答
0
投票

我遇到过同样的问题。我在本文之后配置了eclipse:http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/然后我从armeabi变为armeabi-v7a。然后我无法调试。

我解决了这个问题: 1)您必须修复“调试配置”中的文件夹

  • 主标签更改... obj / local / armeabi / app_process to ... obj / local / armeabi-v7a / app_process
  • 调试器选项卡更改... obj / local / armeabi / gdb2.setup到obj / local / armeabi-v7a / gdb2.setup
  • 调试器选项卡更改... / toolchains / arm-linux-androideabi-4.4.3 / prebuilt / linux-x86_64 / bin / arm-linux-androideabi-gdb to toolchains / arm-linux-androideabi-4.6 / prebuilt / linux-x86_64 / bin中/臂-Linux的androideabi-GDB

2)可能这是解决方法,但它的工作原理。在“调试配置” - >调试器 - >共享库中添加/ obj / local / armeabi-v7a并选中“自动加载共享库符号”

© www.soinside.com 2019 - 2024. All rights reserved.