遇到“管道破裂”;仅在使用 GDB 进行逐步调试时才会出错
有一个用 PHP 编写的 unix-socket 服务器(但我不认为它与之有什么关系)。客户端是用 C++ 编写的,基于 boost::asio 库。当我正常启动程序时 - 一切都工作正常,除了一个我显然想要调试的错误(与套接字通信无关)。但是,当我开始逐步调试时,我立即在对套接字执行写入操作的步骤中收到“损坏的管道”错误。如果在套接字写入操作后设置断点 - 一切正常,直到下一次尝试单步执行写入功能。
花了一整天试图解决这个问题,但没有成功...
有人遇到同样的麻烦吗?
- 在 OS X 10.6.7 下使用与 xCode 3.2.5(64 位)捆绑的 GDB
There is unix-socket server written on PHP (but I don't think it has something to with it). Client side is written on c++ and based on boost::asio library. When I launch program normally - everything works fine, except one (not related to socket communication) bug that I obviously want to debug. But when I start step-by-step debugging it I immediately receive 'Broken Pipe' error on the steps which perform write operations on sockets. If breakpoint is set up after socket write operation - everything work fine until the next attempt to step over the write func.
Spent whole day trying to solve this problem, but unsuccessfully...
Had anyone met the same trouble?
- using GDB bundled with xCode 3.2.5 (64-bit) under OS X 10.6.7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GDB
积极地使用信号。如果您想安装信号处理程序,请查看以下示例:https://github.com/sean-/Boost.Examples/blob/master/asio/timer/timer.cc#L106
GDB
uses signals aggressively. If you want to install signal handlers, check out the following example:https://github.com/sean-/Boost.Examples/blob/master/asio/timer/timer.cc#L106