为什么Eclipse CDT忽略断点? [英] Why does Eclipse CDT ignore breakpoints?

查看:403
本文介绍了为什么Eclipse CDT忽略断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是我在我的代码中设置了一些断点,其中一些不工作。在某些地方,它抱怨未解决的断点。有没有人有任何线索为什么会发生这样的事情?



我正在使用gdb。



编辑:是的,当然是使用调试信息编译的。它只发生在代码中的某些类或点上。而且我很确定该代码的一部分已达到,因为我可以达到它的步骤



编辑:Richard的解决方案不起作用;不管怎么说,还是要谢谢你。我在Debug中进行编译,没有任何优化。

解决方案

可能是您正在尝试在共享库中设置断点尚未加载在图书馆加载之前,这种方式将不起作用。较新的gdb允许设置延迟断点,但CDT可能还没有支持。解决办法是在一个可以从一开始就可以使用的地方设置一个断点,当有问题的共享库已经被加载时,该断点将被到达。然后在共享库中设置其他断点。现在应该工作这有点麻烦,但通常可以工作。



GDB文档


对于地址尚未知的待处理断点,此字段将包含待定。这样的断点将不会触发,直到加载了由断点引用的符号或行的共享库。



My problem is that I set some breakpoints in my code and some of them aren't working. In some places it complains about "Unresolved Breakpoint".

Does anyone have any clue why this is happening? I am using gdb, by the way.

EDIT: Yes, of course is compiled with debug information. It only happens at some classes or points in the code. And I am pretty sure that that part of the code is reached because I can reach it stepping

EDIT: The solution from Richard doesn't work; thanks anyway. I am compiling in Debug, without any optimization.

解决方案

Could it be that you are trying to set breakpoints in a shared library that has not been loaded yet. That won't work until the library has loaded. Newer gdb allow to set deferred breakpoints, but that may not (yet) be supported by CDT. A workaround is to set a breakpoint in a place that is available from the beginning that will be reached when the shared library in question is already loaded. Then set the other breakpoint in the shared library. Now it should work. It's a bit more tedious, but usually works.

From the GDB documentation:

For a pending breakpoint whose address is not yet known, this field will contain 'PENDING'. Such breakpoint won't fire until a shared library that has the symbol or line referred by breakpoint is loaded.

这篇关于为什么Eclipse CDT忽略断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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