我的问题是关于用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的
发布评论