在 Valgrind 中引用共享库的源文件
我们有一个软件项目,其主要目的是提供库和 API。我们还提供使用该库的示例程序和实用程序。
那么,假设我已经构建并安装了我们的库。当我在示例/实用程序之一上运行 valgrind 时,我显然看到了对库中函数的引用。问题是它不提供行号,而我希望它提供。
有没有办法告诉 Valgrind 引用显然不是可执行文件的一部分的源文件,而是链接到可执行文件的库的源代码的一部分?
谢谢!
We have a software project which has the primary purpose of providing a library and API. We also provide example programs and utilities that use this library.
So, let's say that I have built and installed our library. When I run valgrind on one of the example / utility programs, I obviously see references to functions in the library. The issue is that it doesn't provide line numbers, and I would like it to.
Is there a way to tell Valgrind to reference source files that aren't obviously part of an executable, but are part of the source code for a library that is linked-in to the executable?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您使用
-g
编译共享库以添加调试信息。这应该足以让 Valgrind 引用源文件。请参阅http://valgrind.org/docs/manual/faq.html#faq。对于更多信息没有帮助。Make sure that you are compiling shared library with
-g
to add debug information. This should be enough for Valgrind to reference source files. See http://valgrind.org/docs/manual/faq.html#faq.unhelpful for more information.