WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] debugging frustration

Luciano Miguel Ferreira Rocha wrote:

Yes, but an empty macro results in the same thing as a do {} while (0)
a = b
debug_printf("Message");

compiles cleanly if DEBUG is #define'd as ''

At the end of the day, we're dealing with a very imperfect system (cpp). My philosophy on debug() macro's is that they should always map 1-1 to a real function and simply provide that function with __LINE__, __FUNCTION__, and __FILE__.

If you're really concerned about performance, you can #ifdef DEBUG the body of the function and most compilers will correctly do nothing for those calls.

If it's any consolation, the next submission of VM-Tools will have a set of logging functions. I can certainly submit patches to xcs and friends to use these functions..

Regards,

if (ptr == null)
   ;
else
   *ptr = 2

The only problem is when the macro has some code (AFAIK).

--
Anthony Liguori
anthony@xxxxxxxxxxxxx



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>