turn on debug on module level

To turn on debug on function level as follow


debug
scofunc int handshake(void) {
   // code
}

My question: How to turn on debug on module level?

There is no direct method for this but if you look at the libraries supplied with DC you will see how they use a macro to allow you turn on and off debug for each library.

For example, ip.lib has the following:

#ifdef IP_DEBUG
#define _ip_nodebug __debug
#else
#define _ip_nodebug __nodebug
#endif

Each function then has _ip_nodebug as a prefix so you can turn on and off debug for the lib by defining the IP_DEBUG macro if you want debugging or leaving it undefined if you do not.

Regards,
Peter

Thank you, for your point out.