ndk-gdb 无法找到 gdb.setup
ndk-gdb unable to find gdb.setup
我正在尝试使用 ndk-gdb 调试我的原生 android 项目。当我 运行 命令 ndk-gdb 我得到错误
Could not find gdb.setup under ./libs/
说明
- 运行 MacOSX, ndk r10e;使用 ndk 示例 San Angeles
- 按照此处的步骤设置本机调试https://developer.android.com/ndk/guides/ndk-gdb.html
- 基本上我设置了 android:debuggable="true", APP_OPTIM := debug 和 built native using ndk-build NDK_DEBUG=1 (这3个设置可能是多余的,但以防万一)
- 使用ant debug、adb install安装; 运行 应用和应用 运行 没问题
运行 ndk-gdb --verbose 产生
ndk-gdb --verbose
AndroidNDK安装路径:
/Users/hanantha/Documents/Dev/android-ndk-r10e
使用默认的 adb 命令:
/Users/hanantha/Documents/Dev/android-sdk-macosx/platform-tools/adb
找到的 ADB 版本:Android调试桥版本 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-
使用应用输出目录:./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!
我刚刚在 post 中回答:
我运行陷入同样的问题。 Android 构建工具的最新版本似乎发生了一些变化。
诀窍是:
ERROR: Could not find gdb.setup under ./libs/
它期望 gdb.setup 在目录 libs 中,但 NOT libs/armeabi
所以简单的工作是将 gdb.setup 和 gdbserver 从 "libs/cpu" 复制到 "libs",它就像变魔术一样有效!
这是 adb 的错误。 Issue 191085: ndk-gdb issue - Could not find gdb.setup under ./libs/ (even though it's there)
我建议每次调试新项目时 modify ndk-gdb 而不是将 gdb.setup
复制到 libs
:
我正在尝试使用 ndk-gdb 调试我的原生 android 项目。当我 运行 命令 ndk-gdb 我得到错误
Could not find gdb.setup under ./libs/
说明
- 运行 MacOSX, ndk r10e;使用 ndk 示例 San Angeles
- 按照此处的步骤设置本机调试https://developer.android.com/ndk/guides/ndk-gdb.html
- 基本上我设置了 android:debuggable="true", APP_OPTIM := debug 和 built native using ndk-build NDK_DEBUG=1 (这3个设置可能是多余的,但以防万一)
- 使用ant debug、adb install安装; 运行 应用和应用 运行 没问题
运行 ndk-gdb --verbose 产生
ndk-gdb --verbose
AndroidNDK安装路径:
/Users/hanantha/Documents/Dev/android-ndk-r10e
使用默认的 adb 命令:
/Users/hanantha/Documents/Dev/android-sdk-macosx/platform-tools/adb
找到的 ADB 版本:Android调试桥版本 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-
使用应用输出目录:./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!
我刚刚在 post 中回答:
我运行陷入同样的问题。 Android 构建工具的最新版本似乎发生了一些变化。
诀窍是:
ERROR: Could not find gdb.setup under ./libs/
它期望 gdb.setup 在目录 libs 中,但 NOT libs/armeabi
所以简单的工作是将 gdb.setup 和 gdbserver 从 "libs/cpu" 复制到 "libs",它就像变魔术一样有效!
这是 adb 的错误。 Issue 191085: ndk-gdb issue - Could not find gdb.setup under ./libs/ (even though it's there)
我建议每次调试新项目时 modify ndk-gdb 而不是将
gdb.setup
复制到libs
: