Version 0 of Hacking on The Core

Updated 2015-04-26 01:11:10 by pooryorick

Hacking on The Core — it's good for the soul!

Some Debugging Macros

PYK 2015-04-25: I'm still learning the ropes of C, but I'll throw these here anyway. They came in handy recently to debug an I/O/thread issue.

#define tdebug(statement) do { \
    fprintf(stderr ,"%p: %s\n" ,Tcl_GetCurrentThread() ,(statement)); \
} while (0)

#define tcdebug(statePtr, statement) do { \
    fprintf(stderr ,"%p: chan %s:  %s\n" ,Tcl_GetCurrentThread() ,(statePtr->channelName) ,(statement)); \
} while (0)