远程调试共享库使用gdb / gdbserver的 [英] Debugging shared libraries remotely with gdb/gdbserver

查看:179
本文介绍了远程调试共享库使用gdb / gdbserver的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于用gdb / gdbserver的的嵌入式ARM处理器的远程调试应用程序。

My question is about remote debugging an application on an embedded arm processor using gdb/gdbserver.

我可以调试应用程序本身,而是应用程序动态链接到这家通信协议实现了共享库。我希望能够到共享库函数内设置断点,以便揣摩一些设备发现的问题。

I can debug the application itself, but the application dynamically links to a shared library which implements an in house communications protocol. I want to be able to set breakpoints within the shared library functions so try to figure out some device discovery problems.

我已经确定该库编译调试符号,是由GDB装在主机端,我可以在图书馆内列出的功能,甚至设置断点,但只要我尝试运行应用程序,我得到一个错误信息的影响:

I have made sure that the library is compiled with debug symbols and is loaded by gdb on the host side, I can list functions within the library and even set the breakpoints but as soon as I try to run the application I get an error message to the effect of:


无法插入断点十结果
错误访问内存地址:输入/输出错误。

其中X是GDB断点号,是一个地址远小的才有效。结果
我对目标使用目标和主机上都新图书馆,而是通过安装邻绑定newlib oldlib 从NFS挂载。结果
有没有人有可能是错误的想法?
先谢谢了。

where X is the breakpoint number in gdb and is an address far to small to be valid.
I am using the new library on both the target and the host machine, but via mount -o bind newlib oldlib on the target from an nfs mount.
Does anyone have an idea about what could be wrong? Thanks in advance.

推荐答案

大胆猜测:您加载的共享库到主机 GDB 在不正确的地址

Wild guess: you loaded the shared library into host GDB at incorrect address.

而不是明确地加载到GDB,使用设置止损上solib事件,等待得到加载库(信息共享将告诉您加载库的当前目录)和然后的设置断点。

Instead of explicitly loading it into GDB, use "set stop-on-solib-event on", wait for the library to get loaded (info shared will tell you current list of loaded libraries), and then set the breakpoints.

这篇关于远程调试共享库使用gdb / gdbserver的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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