views:

74

answers:

2

Hi all,

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.

A: 

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.

VonC
A: 

VS2010 presents anew future called Call Hierarchy of Methods that provides you with a tree view at design time

This tree view contains all (methods, prop., or whatever called the method) that calls the applied method

here is how try that in VS2010.

http://blog.flair-systems.com/2010/05/c-fastfood-call-hierarchy-of-methods.html

Waleed Mohamed