1
1
/*****************************************************************************
3
Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
3
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
Place, Suite 330, Boston, MA 02111-1307 USA
17
17
*****************************************************************************/
57
54
const char* file, /*!< in: source file containing the assertion */
58
55
ulint line); /*!< in: line number of the assertion */
60
#if defined(__WIN__) || defined(__INTEL_COMPILER)
61
# undef UT_DBG_USE_ABORT
62
#elif defined(__GNUC__) && (__GNUC__ > 2)
63
# 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
66
#ifndef UT_DBG_USE_ABORT
74
# ifndef UT_DBG_USE_ABORT
67
75
/** A null pointer that will be dereferenced to trigger a memory trap */
68
76
extern ulint* ut_dbg_null_ptr;
71
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
79
# if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
72
80
/** If this is set to TRUE by ut_dbg_assertion_failed(), all threads
73
81
will stop at the next ut_a() or ut_ad(). */
74
82
extern ibool ut_dbg_stop_threads;
81
89
/*===============*/
86
#ifdef UT_DBG_USE_ABORT
94
# ifdef UT_DBG_USE_ABORT
87
95
/** Abort the execution. */
88
# define UT_DBG_PANIC abort()
96
# define UT_DBG_PANIC abort()
89
97
/** Stop threads (null operation) */
90
# define UT_DBG_STOP do {} while (0)
91
#else /* UT_DBG_USE_ABORT */
98
# define UT_DBG_STOP do {} while (0)
99
# else /* UT_DBG_USE_ABORT */
92
100
/** Abort the execution. */
93
# define UT_DBG_PANIC \
101
# define UT_DBG_PANIC \
94
102
if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
95
103
/** Stop threads in ut_a(). */
96
# define UT_DBG_STOP do \
104
# define UT_DBG_STOP do \
97
105
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
98
106
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
100
#endif /* UT_DBG_USE_ABORT */
108
# endif /* UT_DBG_USE_ABORT */
109
#endif /* __NETWARE__ */
102
111
/** Abort execution if EXPR does not evaluate to nonzero.
103
112
@param EXPR assertion expression that should hold */