Version 1 of Hacking on The Core

Updated 2015-04-26 17:49:19 by RLE

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)