If you mean "How can I track the execution path of my code?" Then you need to use the source level symbolic debugger.
On Linux, this usually means using GDB, for which there are a number of GUI interfaces; using GDB on the command line is cryptic and time-consuming, it can be used, for example, through Eclipse or KDevelop or the standalone Insight debugger. On Windows, the debugger will be specific to the compiler, but VC ++ has the best debugger available (and free in Express Edition).
In response to davit edit
Define the TRACE macro as follows:
#if defined NDEBUG
#define TRACE( format, ... )
#else
#define TRACE( format, ... ) printf( "%s::%s(%d)" format, __FILE__, __FUNCTION__, __LINE__, __VA_ARGS__ )
#endif
, "%s::%s(%d)" format . . , .