ndk-gdb cannot find gdb.setup but it is there under x86

社会主义新天地 提交于 2019-12-07 18:46:20

问题


Cocos2d-x 3.7.1 + ndk r10e project on Mac trying to debug in Eclipse. Days pass and the errors keep coming...

I can build and run using cocos compile and cocos run with -p android -m debug --ndk-mode NDK_DEBUG=1 from the terminal in proj.android.

My app runs Ok (eventually) on my x86 emulator no problem.

Typing 'ndk-gdb' in the terminal from ./proj.android and I get the error

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

BUT the file gdb.setup (and gdbserver & libcocos2dcpp.so) can be seen in ./proj.android/libs/x86 !?

My AndroidManifest.xml includes android:debuggable="true"

My jni/Application.mk includes APP_ABI := x86 (only)

If anyone can tell me how I can diagnose or fix this problem then I guess I owe them a beer (in Yorkshire btw)

UPDATE: I have tried running up GDB using the --verbose flag. The output shows

Using gdb setup init: ./libs/armeabi/gdb.setup

Using app out directory: ./obj/local/armeabi

Guess I need to change to settings/init file somewhere??


回答1:


I ran into the same problem. It seems something changed in recent version of Android Build tools.

The trick is:

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

It expects gdb.setup is in the directory libs but NOT libs/armeabi

so the simple workground is to copy gdb.setup and gdbserver from "libs/cpu" to "libs" and it works like a magic!




回答2:


  • This is a bug caused by adb from android sdk.Issue 191085: ndk-gdb issue - Could not find gdb.setup under ./libs/ (even though it's there)

  • Currently previewl channel's adb whose version is 1.0.35 still has the same problem.

  • Without revert adb to 1.0.31.A simple workaround would be modify ndk-gdb a little: change the line if [ $? = 0 ]; then which is below adb_var_shell BCFILES run-as $PACKAGE_NAME /system/bin/sh -c "ls lib/*.bc" to if [ $? = 1 ]; then


来源:https://stackoverflow.com/questions/32437554/ndk-gdb-cannot-find-gdb-setup-but-it-is-there-under-x86

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!