Compile PDBG() in release mode too

Formerly, GENODE_RELEASE just undef'd PDBG() which concealed bugs in
places PDBG was used, e.g., do to API changes. Unfortunately,
desparately disabling GENODE_RELEASE during bug hunt sometimes
introduced new errors. Now, PDBG is just a branch not taken but seen by
the compiler, which is able to produce warnings/errors when the API is
changed.

Fixes #378.
This commit is contained in:
Christian Helmuth 2012-10-01 12:40:31 +02:00 committed by Norman Feske
parent 6862ab481a
commit 4017e592f0

View File

@ -63,21 +63,23 @@ namespace Genode {
* otherwise nothing (not even the comma) is appended.
*/
/**
* Print debug message with function name
*/
#define PDBG(fmt, ...) \
Genode::printf("%s: " ESC_DBG fmt ESC_END "\n", \
__PRETTY_FUNCTION__, ##__VA_ARGS__ )
/**
* Suppress debug messages in release version
*/
#ifdef GENODE_RELEASE
#undef PDBG
#define PDBG(fmt, ...)
#define DO_PDBG false
#else
#define DO_PDBG true
#endif /* GENODE_RELEASE */
/**
* Print debug message with function name
*/
#define PDBG(fmt, ...) \
if (DO_PDBG) \
Genode::printf("%s: " ESC_DBG fmt ESC_END "\n", \
__PRETTY_FUNCTION__, ##__VA_ARGS__ )
/**
* Print log message
*/