Eclipse CDT 和 GDB 调试。结构体成员的值
我刚刚从 Visual Studio 2010 切换到 Eclipse (Ubuntu)。
我有一个像 CvCapture *capture 这样的全局初始化结构。
如何在调试窗口中获取捕获成员的值?捕获甚至不显示在变量窗口中。我添加了监视表达式,但没有获得捕获的成员值。
编辑:屏幕截图http://tinypic.com/r/10s6x3q/5。另外,我无法在变量窗口中添加全局变量。它不活跃。
I just switched from Visual Studio 2010 to Eclipse (Ubuntu).
I have a global initialized structure like this CvCapture *capture.
How can I get values of capture members in debug window? capture even is not shown in Variables window. I have added watch expression, but I don't get members values of capture.
Edited: Screenshot http://tinypic.com/r/10s6x3q/5 . Plus I can't Add Global Variable in Variables window. It's inactive.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
struct CvCapture*
是一个不透明句柄(请参阅 en.wikipedia.org/wiki/Opaque_pointer ) : 用户不应该看到里面的内容。它的内容仅在库代码中声明,您无法在任何导出的包含文件中找到它,例如 highgui.h(仅向前声明),Eclipse 也没有。
你可以做什么:
在调试模式下重新编译 highgui 库,将程序与其链接,启动调试会话并输入库的函数之一,例如
cvGetCaptureProperty()
。一旦出现,gdb 将能够看到 struct CvCapture 的内容(在 _highgui.h 中定义),并且 Eclipse 将向您显示它。struct CvCapture*
is an opaque handle (see en.wikipedia.org/wiki/Opaque_pointer) : users are not supposed to see what is inside.Its content is declared only in the library code, you cannot find it in any exported include like highgui.h (where it is only forward-declared), and neither does Eclipse.
What you can do :
Recompile the highgui library in debug-mode, link your program with it, launch a debugging session and enter one of the library's functions such as
cvGetCaptureProperty()
. Once there gdb will be able to see the content ofstruct CvCapture
(defined in _highgui.h) and Eclipse will show it to you.