GDB 在 Eclipse 中的 longjmp 上崩溃
我在eclipse中使用c来编写程序。我需要使用GDB来一步步调试。但是,在 longjmp 命令上(当我尝试保存堆栈上下文时)GDB 在 eclipse 内崩溃(因为那里有一个断点?)有什么办法解决这个问题吗?在过去的六个小时里,我已经在互联网上进行了搜索,但似乎无法找到解决方案。这是崩溃的代码行,
if(setjmp(p->jbContext) == 0)
longjmp(context_buf,1);
我将非常感谢任何可以提供帮助的人。
谢谢!
编辑:经过进一步搜索,我找到了这个网页,但不知道如何使用它。
http://www.delorie.com/gnu/docs/gdb/gdb_271.html
如有帮助,我们将不胜感激!
I am using c in eclipse to write a program. I need to use GDB to debug it step by step. However on a longjmp command (when i try to save the context of a stack) GDB crashes inside eclipse (because there is a breakpoint there?) Is there any way around this? I have scoured the internets for the past six hours and cannot seem to be able to find a solution. Here is the line of code where it is crashing
if(setjmp(p->jbContext) == 0)
longjmp(context_buf,1);
I would be very very grateful to anyone that can help.
Thanks!
EDIT: After further searching I found this webpage but have no clue as to how to use it.
http://www.delorie.com/gnu/docs/gdb/gdb_271.html
Assistance would be appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果确实是
gdb
崩溃了,您可以考虑(在向他们报告错误后)安装它的更新版本。最新的 GDB 是版本 7.3.1 - 你可以编译它如果需要的话,它的源代码。如果您足够勇敢并且该错误在最新版本中仍然存在,请尝试找到该错误并提出补丁。我对 gdb 崩溃(这种情况很少见)的经验是,获取和构建最新版本有很大帮助。许多 Linux 发行版不提供最新的 GDB。
当然,您可能还需要升级您的 GCC 编译器:生成的调试信息也得到了改进。
If it is really
gdb
which crashes, you could consider (after reporting the bug to them) install a newer version of it. Latest GDB is version 7.3.1 -you can compile it from its source code if needed. If you are brave and the bug persists with the latest version, try to find the bug and propose a patch.My experience with gdb crashes (which are rare) is that getting and building the newest version helps a lot. Many Linux distributions don't ship a very recent GDB.
Of course, you might need to upgrade your GCC compiler also: the debugging information that is generated has also improved.