Eclipse 调用层次结构会跳过未定义的 #ifdef 区域中的调用
Eclipse CDT 中的“调用层次结构”和“声明”功能会忽略未定义(灰显)#ifdef 区域中存在的结果。
示例:
void blah(void) {
#ifndef ABC
foo();
#else //line is greyed out
bar(); //line is greyed out
#endif //line is greyed out
}
foo() 的调用层次结构会将 blah() 列为调用者; bar() 的调用层次结构不会列出 blah()。
我并不期望它能够完全解析将编译哪些 #define 块,我只是希望它返回我正在搜索的函数的所有调用/声明,而不管它周围的 #define 块如何。
其他 IDE(例如 SlickEdit)可以执行此操作。
有谁知道让 Eclipse 采用这种行为的方法吗?
谢谢。
The "call hierarchy" and "declaration" features in Eclipse CDT omit results that exist in undefined (greyed out) #ifdef regions.
Example:
void blah(void) {
#ifndef ABC
foo();
#else //line is greyed out
bar(); //line is greyed out
#endif //line is greyed out
}
The call hierarchy for foo() will list blah() as a caller; the call hierarchy for bar() will not list blah().
I'm not expecting it to do full resolution of which #define blocks will get compiled, I simply would like it to return all calls/declarations of the function I'm searching for, regardless of the #define blocks that surround it.
Other IDEs such as SlickEdit are able to do this.
Does anyone know of a way to get Eclipse to adopt this behavior?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CDT“调用层次结构”功能上存在许多“错误”:
所有这些都与绑定解析相关(也是这种情况将改进 CDT7.0 中的隐式构造函数调用)。
由于 bar() 显然位于 无法访问的 #ifdef 块内, “绑定决议”很可能会完全忽略它。
因此,校准层次结构不完整。
There are many "bugs" opened on the CDT "Call Hierarchy" feature:
All of them are linked to the binding resolution (also the situation will improve for implicit constructor calls in CDT7.0).
And since bar() is clearly within an Unreachable #ifdef block, chances are the "binding resolution" will ignore it completely.
Hence the incomplete cal hierarchy.
我在 Windows 7 64Bit Ultimate 上使用 Eclipse 3.6.2 和 PDT 2.x。
我希望看到调用该方法的所有位置的列表,但是我基本上只看到该方法本身的声明。如果我切换到“被调用者”层次结构,情况也是如此。即使调用该方法或调用同一文件中的方法。
I'm using Eclipse 3.6.2 with PDT 2.x on Windows 7 64Bit Ultimate.
I would expect to see a list of all the places where the method was called from, however I basically only see the declaration of the method itself. Same if I switch to 'callee' hierarchy. Even when the method is called or calls methods in the same file.