mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-25 07:41:36 +02:00
DEBUG: improve BUG_ON output message accuracy
Now we'll explicitly mention if the test was a bug/warn/check, and "FATAL" is only displayed when the process crashes. The non-crashing BUG_ON() also suggests to report to developers.
This commit is contained in:
parent
6d3f1e322e
commit
ef16578822
@ -112,12 +112,12 @@
|
|||||||
*/
|
*/
|
||||||
#if defined(DEBUG_STRICT)
|
#if defined(DEBUG_STRICT)
|
||||||
# define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 3, "FATAL: bug ", "")
|
# define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 3, "FATAL: bug ", "")
|
||||||
#define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
# define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: warn ", " (please report to developers)")
|
||||||
#define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
# define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: check ", " (please report to developers)")
|
||||||
#elif defined(DEBUG_STRICT_NOCRASH)
|
#elif defined(DEBUG_STRICT_NOCRASH)
|
||||||
#define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 2, "FATAL: bug ", " (not crashing but process is untrusted now)")
|
# define BUG_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 2, "WARNING: bug ", " (not crashing but process is untrusted now, please report to developers)")
|
||||||
#define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
# define WARN_ON(cond) _BUG_ON (cond, __FILE__, __LINE__, 0, "WARNING: warn ", " (please report to developers)")
|
||||||
#define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: ", " (please report to developers)")
|
# define CHECK_IF(cond) _BUG_ON_ONCE(cond, __FILE__, __LINE__, 0, "WARNING: check ", " (please report to developers)")
|
||||||
#else
|
#else
|
||||||
# define BUG_ON(cond)
|
# define BUG_ON(cond)
|
||||||
# define WARN_ON(cond)
|
# define WARN_ON(cond)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user