mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
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:
parent
6862ab481a
commit
4017e592f0
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user