简体   繁体   English

Eclipse(开普勒)未显示结构成员

[英]Eclipse (kepler) doesn't show structure members

I am pretty new to eclipse, therefore what may seem obvious to others is to me a mystery, and of course I'm sorry for that. 我对日食非常陌生,因此对其他人来说似乎显而易见的是一个谜,当然,对此我感到抱歉。 While building project under Eclipse IDE for C/C++ Developers (Version: Kepler Service Release 1, Build id: 20130919-0819 on Win 7 64bit) and MinGW toolchain, debugger variables view doesn't want to show me couple of things. 在C / C ++开发人员(版本:Kepler Service Release 1,版本ID:20130919-0819,在Win 7 64bit上)和MinGW工具链下使用Eclipse IDE构建项目的同时,调试器变量视图并不想告诉我几件事。 It starts as I define structure within structure, like this: 它从我在结构中定义结构开始,如下所示:

typedef     struct
{
    int i1;
    int i2;
}ts;


typedef struct
{
    int i;
    ts  s1;
    ts  s2;
}t_mystruct;

I get this in a variable view of the debugger: 我在调试器的变量视图中得到此信息:

在此处输入图片说明

instead of: 代替:

在此处输入图片说明

I could do relatively much (thanks to google and stackoverflow) with all the headaches eclipse gave me till now, but this one seems to be a little tougher, not even google would say much about this. 到现在为止,所有的日食让我头痛不已,我可以做很多事情(这要归功于google和stackoverflow),但这似乎有点困难,甚至连google都不会说太多。 So it's either new, or that obvious, that only a eclipse novice like myself could have troubles there. 因此,这是新的还是显而易见的,只有像我这样的日食新手才能在这里遇到麻烦。


Second question would be why is there an empty space, where I would like to see members of a s1 structure? 第二个问题是,为什么我想要看到s1结构的成员会有一个空白? It seems always to favor the first structure I open to view, and the second one is always blank space - this couldn't be any convenient in any possible way :( The same goes for the memory view - if it's a nested structure member can't open the memory view for it due to false/unknown address. 似乎总是喜欢我打开查看的第一个结构,而第二个结构始终是空白-这在任何可能的方式上都不方便:(内存视图也是如此-如果它是嵌套的结构成员,则可以由于地址错误/未知,因此无法为其打开内存视图。

I do think, that debugger should have some kind of a parsing troubles with those structures, but unluckily for me, I don't know which thread to pull first. 我确实认为,调试器应该在解析这些结构时遇到麻烦,但是对我来说很不幸,我不知道首先拉哪个线程。

Link to the full project code. 链接到完整的项目代码。

thanks to my colleague I've found out, that using "Standard Create Process Launcher" instead of GDB (DSF) gives me the opportunity to have a nice bug free (maybe almost) debug session. 多亏了我的同事,我发现,使用“标准创建流程启动器”而不是GDB(DSF)使我有机会进行一个不错的(可能几乎没有)错误的调试。

在此处输入图片说明

I can live with that as long as I don't know why should I use the other launcher. 只要不知道为什么要使用其他启动器,我就可以接受。

This is not the complete answer, but some testing results which hopefully can be helpful: 这不是完整的答案,但是一些测试结果可能会有所帮助:

I tried your example under Kepler SR1 on Linux (Ubuntu) with default toolchain (Linux GCC), and it seems working fine there: expanded variables on Linux 我在具有默认工具链(Linux GCC)的Linux(Ubuntu)上的Kepler SR1下尝试了您的示例,并且在这里看起来工作正常: 在Linux上扩展了变量

But under Kepler SR1 on Windows 8 I have the same issues as you: both "no member" and "empty space". 但是在Windows 8上的Kepler SR1下,我遇到了与您相同的问题:“无成员”和“空空间”。 By some reason it tries to evaluate the wrong expression ( (mydat).i2 instead of (mydat).s2.i2 ) and receives the corresponding answer from gdb ("There is no member named i2"). 由于某种原因,它尝试评估错误的表达式( (mydat).i2而不是(mydat).s2.i2 ),并从gdb接收相应的答案(“没有名为i2的成员”)。

This is a small test with gdb in console with expected results: gdb console test (see the last 2 commands) 这是在控制台中对gdb进行的小测试,具有预期的结果: gdb控制台测试 (请参阅最后2个命令)

It looks like the UI bugs in Windows version of Eclipse or something. 看起来像Windows版本的Eclipse中的UI错误。

I can confirm that the answer provided by Sangesi, to use the "Standard Create Process Launcher" instead of GDB (DSF) works for me too. 我可以确认,由Sangesi提供的使用“标准创建流程启动器”而不是GDB(DSF)的答案也适用于我。 (I can't Vote Up or Comment on his answer as I do not have enough reputation points yet.) (由于我没有足够的声望点,因此我无法对他的答案进行投票或评论。)

Verified using Eclipse Indigo on Windows 7, CDT v8.0.2, Cygwin, gdb v7.6.50. 在Windows 7,CDT v8.0.2,Cygwin,gdb v7.6.50上使用Eclipse Indigo进行了验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM