54
54
const char* file, /*!< in: source file containing the assertion */
55
55
ulint line); /*!< in: line number of the assertion */
57
#if defined(__WIN__) || defined(__INTEL_COMPILER)
58
# undef UT_DBG_USE_ABORT
59
#elif defined(__GNUC__) && (__GNUC__ > 2)
60
# define UT_DBG_USE_ABORT
58
/** Flag for ignoring further assertion failures. This is set to TRUE
59
when on NetWare there happens an InnoDB assertion failure or other
60
fatal error condition that requires an immediate shutdown. */
61
extern ibool panic_shutdown;
62
/* Abort the execution. */
63
void ut_dbg_panic(void);
64
# define UT_DBG_PANIC ut_dbg_panic()
65
/* Stop threads in ut_a(). */
66
# define UT_DBG_STOP do {} while (0) /* We do not do this on NetWare */
67
#else /* __NETWARE__ */
68
# if defined(__WIN__) || defined(__INTEL_COMPILER)
69
# undef UT_DBG_USE_ABORT
70
# elif defined(__GNUC__) && (__GNUC__ > 2)
71
# define UT_DBG_USE_ABORT
63
#ifndef UT_DBG_USE_ABORT
74
# ifndef UT_DBG_USE_ABORT
64
75
/** A null pointer that will be dereferenced to trigger a memory trap */
65
76
extern ulint* ut_dbg_null_ptr;
68
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
79
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
69
80
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
70
81
will stop at the next ut_a() or ut_ad(). */
71
82
extern ibool ut_dbg_stop_threads;
78
89
/*===============*/
83
#ifdef UT_DBG_USE_ABORT
94
# ifdef UT_DBG_USE_ABORT
84
95
/** Abort the execution. */
85
# define UT_DBG_PANIC abort()
96
# define UT_DBG_PANIC abort()
86
97
/** Stop threads (null operation) */
87
# define UT_DBG_STOP do {} while (0)
88
#else /* UT_DBG_USE_ABORT */
98
# define UT_DBG_STOP do {} while (0)
99
# else /* UT_DBG_USE_ABORT */
89
100
/** Abort the execution. */
90
# define UT_DBG_PANIC \
101
# define UT_DBG_PANIC \
91
102
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
92
103
/** Stop threads in ut_a(). */
93
# define UT_DBG_STOP do \
104
# define UT_DBG_STOP do \
94
105
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
95
106
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
97
#endif /* UT_DBG_USE_ABORT */
108
# endif /* UT_DBG_USE_ABORT */
109
#endif /* __NETWARE__ */
99
111
/** Abort execution if EXPR does not evaluate to nonzero.
100
112
@param EXPR assertion expression that should hold */