gpt4 book ai didi

android - ndk-gdb 无法找到 gdb.setup

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:46:35 24 4
gpt4 key购买 nike

我正在尝试使用 ndk-gdb 调试我的原生 android 项目。当我运行命令 ndk-gdb 时出现错误

 Could not find gdb.setup under ./libs/

解释

  • 运行 MacOSX,ndk r10e;使用 ndk 示例 San Angeles
  • 按照此处的步骤设置 native 调试 https://developer.android.com/ndk/guides/ndk-gdb.html
  • 基本上我设置了 android:debuggable="true", APP_OPTIM := debug 并使用 ndk-build NDK_DEBUG=1 构建原生(这 3 个设置可能是多余的,但以防万一)
  • 使用ant debug、adb install安装;运行应用程序,应用程序运行良好
  • 运行 ndk-gdb --verbose 产生

    ndk-gdb --verbose

    安卓NDK安装路径:

      /Users/hanantha/Documents/Dev/android-ndk-r10e

    使用默认的 adb 命令:

     /Users/hanantha/Documents/Dev/android-sdk-macosx/platform-tools/adb

    找到的 ADB 版本:Android Debug Bridge 版本 1.0.32

     Revision eac51f2bb6a8-android

    使用 ADB 标志:

    使用JDB命令:

    /usr/bin/jdb

    使用自动检测的项目路径:.

    找到包名:com.example.SanAngeles

    应用程序的目标 ABI:arm64-v8a armeabi armeabi-v7a armeabi-v7a mips mips64 x86 x86_64

    设备 API 级别:19

    设备 CPU ABI:x86

    兼容设备 ABI:

    使用 gdb 设置初始化:

     ./libs/armeabi/gdb.setup

    使用工具链前缀:

     /Users/hanantha/Documents/Dev/android-ndk-r10e/toolchains/x86-4.8/prebuilt/darwin-x86_64/bin/i686-linux-android-

    使用app出目录:./obj/local/armeabi

    找到可调试标志:true

    错误:

        Could not find gdb.setup under ./libs/
    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!

最佳答案

我刚刚在帖子里回复了:https://stackoverflow.com/a/32972182/1617066

我遇到了同样的问题。最近版本的 Android 构建工具似乎发生了一些变化。

诀窍是:

ERROR: Could not find gdb.setup under ./libs/

它期望 gdb.setup 在目录 libsNOT libs/armeabi

所以简单的工作是将 gdb.setup 和 gdbserver 从“libs/cpu”复制到“libs”,它就像魔术一样工作!

关于android - ndk-gdb 无法找到 gdb.setup,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32970481/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com