为什么Eclipse CDT忽略断点? [英] Why does Eclipse CDT ignore breakpoints?
问题描述
我正在使用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屋!