NDK-gdb的多个这样的库 [英] ndk-gdb with multiple so libs

查看:170
本文介绍了NDK-gdb的多个这样的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我学会了NDK-gdb的从Android的NDK R4调试工具。现在我可以开始调试HELLO-JNI样品(虽然存在着一些问题)。

I learned about the debug tool of "ndk-gdb" from Android NDK r4. Now I can start debugging the hello-jni sample(although some issue exists).

不过,我自己的Andr​​oid应用程序,我有几个这样的库使用,构建起了大量的C / C ++文件。我用来建立这些所谓与NDK建造文件,然后复制这些所以在$ PROJECT / libs目录文件,它工作正常无需调试。但现在我想调试与NDK-gdb的一个,这样库。当我开始NDK-gdb的,它抱怨说,没有符号表被加载。

But, for my own Android applications, I have several so libs to use, build from a large number of c/c++ files. I used to build these so files with ndk-build, and then copy these so files under $PROJECT/libs directory, and it works fine without debugging. But now I want to debug one so lib with ndk-gdb. When I started ndk-gdb, it complains that no symbol table is loaded.

我也复制所有这些所谓的文件$ PROJECT /斌/ NDK /本地/ armeabi(好像在哪里GDB尝试加载符号表的默认目录)。而且是,这是行不通的。

I also copy all these so files to $PROJECT/bin/ndk/local/armeabi(seems like the default directory where gdb tries to load symbol table). And still, it doesn't work.

也许NDK-gdb的后,我复制它们无法跟踪我这样的文件吗?或者为什么它不能加载任何符号表,即使是在我将它们复制在$ PROJECT /斌/ NDK /本地/ armeabi?

Maybe ndk-gdb can't track my so files after I copy them? Or why it can't load any symbol tables, even after I copy them under $PROJECT/bin/ndk/local/armeabi?

有这个问题之前,任何人见面?

Have anyone meet with this issue before?

非常感谢!

推荐答案

我想你将它们复制到错误的文件夹。旧的NDK复制文件到bin文件夹;新一它们复制到OBJ文件夹,而这也正是它指向GDB查找符号。

I think you're copying them to the wrong folder. The older NDK copied files to the bin folder; the new one copies them to the obj folder, and that's where it points gdb to look for symbols.

另外,要确保你复制pre-剥离.so文件到obj的文件夹,而不是您复制到libs文件夹相同的文件:在库作为构建过程的一部分,该文件文件夹被剥夺的符号和调试信息。所以你要保持你的每个.so文件的两个副本:一个从libs文件夹安装在Android设备上,一个来自obj的文件夹中安装了GDB从得到的符号

Also, be sure that you copy the pre-stripped .so files to the obj folder, and not the same files that you copy to the libs folder: As part of the build process, the files in the libs folder have been stripped of symbols and debugging information. So you'll want to keep two copies of each of your .so files: One from the libs folder to install on the Android device, and one from the obj folder to install for GDB to get symbols from.

您可以,而不是拷贝在应用程序树中的调试文件的OBJ文件夹,添加其他构建目录OBJ /文件夹,GDB的符号搜索路径。 NDK建造备案,gdb.setup,包括与设置solib搜索路径开头的一行。你可以把上线,包括所有目标的OBJ /本地/文件夹的任何一个冒号分隔的路径,然后GDB会找到的符号。

You could, instead of copying the debug files to the obj folder in your app tree, add the other build directory obj/ folders to gdb's symbol search path. ndk-build sets up a file, gdb.setup, that includes a line that starts with set solib-search-path. You can put a colon-separated path on that line that includes all of your target obj/local/whatever folders, and then gdb will find the symbols.

这篇关于NDK-gdb的多个这样的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆