C
call_me_anything
Here is a code to have a debug printf :
#ifdef DEBUG
#define DEBUG_printf(...)
{printf("[%s]:",__FUNCTION__);printf(__VA_ARGS__);printf("\n");}
#else
#define DEBUG
#endif
int main () {
DEBUG_printf ("%d %s", 5, "abc");
}
Is there something similar, which can print the current stack ?
I mean some C/C++ API which can help me get any info related to the
current stack of functions.
Thats is required for debugging.
(Please do not suggest gdb... I want something similar to gdb stack
traces but that should print stack info everytime I compile with DEBUG
on)
#ifdef DEBUG
#define DEBUG_printf(...)
{printf("[%s]:",__FUNCTION__);printf(__VA_ARGS__);printf("\n");}
#else
#define DEBUG
#endif
int main () {
DEBUG_printf ("%d %s", 5, "abc");
}
Is there something similar, which can print the current stack ?
I mean some C/C++ API which can help me get any info related to the
current stack of functions.
Thats is required for debugging.
(Please do not suggest gdb... I want something similar to gdb stack
traces but that should print stack info everytime I compile with DEBUG
on)