远程调试共享库使用gdb / gdbserver的

编程入门 行业动态 更新时间:2024-10-08 14:41:18
本文介绍了远程调试共享库使用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的

本文发布于:2023-11-24 14:18:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1625555.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:gdb   gdbserver

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!