drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
ut0dbg.h File Reference
#include "univ.i"
#include <stdlib.h>
#include "os0thread.h"
Include dependency graph for ut0dbg.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ut0dbg_h
#define UT_DBG_FAIL(EXPR)
#define UT_DBG_PANIC    if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL
#define UT_DBG_STOP
#define ut_a(EXPR)
#define ut_error
#define ut_ad(EXPR)
#define ut_d(EXPR)
#define UT_NOT_USED(A)

Functions

UNIV_INTERN void ut_dbg_assertion_failed (const char *expr, const char *file, ulint line)
UNIV_INTERN void ut_dbg_stop_thread (const char *file, ulint line)

Variables

ulint ut_dbg_zero
ulint * ut_dbg_null_ptr
ibool ut_dbg_stop_threads

Detailed Description

Debug utilities for Innobase

Created 1/30/1994 Heikki Tuuri

Definition in file ut0dbg.h.

Macro Definition Documentation

◆ ut0dbg_h

#define ut0dbg_h

Definition at line 28 of file ut0dbg.h.

◆ ut_a

#define ut_a ( EXPR)
Value:
do { \
if (UT_DBG_FAIL(EXPR)) { \
ut_dbg_assertion_failed(#EXPR, \
__FILE__, (ulint) __LINE__); \
} \
} while (0)
#define UT_DBG_PANIC
Definition ut0dbg.h:94
#define UT_DBG_STOP
Definition ut0dbg.h:97
#define UT_DBG_FAIL(EXPR)
Definition ut0dbg.h:45

Abort execution if EXPR does not evaluate to nonzero.

Parameters
EXPRassertion expression that should hold

Definition at line 105 of file ut0dbg.h.

◆ ut_ad

#define ut_ad ( EXPR)

Debug assertion. Does nothing unless UNIV_DEBUG is defined.

Definition at line 127 of file ut0dbg.h.

◆ ut_d

#define ut_d ( EXPR)

Debug statement. Does nothing unless UNIV_DEBUG is defined.

Definition at line 129 of file ut0dbg.h.

◆ UT_DBG_FAIL

#define UT_DBG_FAIL ( EXPR)
Value:
!((ulint)(EXPR) + ut_dbg_zero)
ulint ut_dbg_zero
Definition ut0dbg.cc:33

Test if an assertion fails.

Parameters
EXPRassertion expression
Returns
nonzero if EXPR holds, zero if not

Definition at line 45 of file ut0dbg.h.

◆ UT_DBG_PANIC

#define UT_DBG_PANIC    if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL

Abort the execution.

Definition at line 94 of file ut0dbg.h.

◆ UT_DBG_STOP

#define UT_DBG_STOP
Value:
do \
if (UNIV_UNLIKELY(ut_dbg_stop_threads)) { \
ut_dbg_stop_thread(__FILE__, (ulint) __LINE__); \
} while (0)
ibool ut_dbg_stop_threads
Definition ut0dbg.cc:39

Stop threads in ut_a().

Definition at line 97 of file ut0dbg.h.

◆ ut_error

#define ut_error
Value:
do { \
ut_dbg_assertion_failed(0, __FILE__, (ulint) __LINE__); \
} while (0)

Abort execution.

Definition at line 115 of file ut0dbg.h.

◆ UT_NOT_USED

#define UT_NOT_USED ( A)
Value:
A = A

Silence warnings about an unused variable by doing a null assignment.

Parameters
Athe unused variable

Definition at line 134 of file ut0dbg.h.

Function Documentation

◆ ut_dbg_assertion_failed()

UNIV_INTERN void ut_dbg_assertion_failed ( const char * expr,
const char * file,
ulint line )

Report a failed assertion. in: line number of the assertion

Report a failed assertion.

Parameters
exprin: the failed assertion (optional)
filein: source file containing the assertion
linein: line number of the assertion

Definition at line 53 of file ut0dbg.cc.

◆ ut_dbg_stop_thread()

UNIV_INTERN void ut_dbg_stop_thread ( const char * file,
ulint line )

Stop a thread after assertion failure.

Definition at line 94 of file ut0dbg.cc.

Variable Documentation

◆ ut_dbg_null_ptr

ulint* ut_dbg_null_ptr
extern

A null pointer that will be dereferenced to trigger a memory trap

Definition at line 43 of file ut0dbg.cc.

◆ ut_dbg_stop_threads

ibool ut_dbg_stop_threads
extern

If this is set to TRUE by ut_dbg_assertion_failed(), all threads will stop at the next ut_a() or ut_ad().

Definition at line 39 of file ut0dbg.cc.

◆ ut_dbg_zero

ulint ut_dbg_zero
extern

This is used to eliminate compiler warnings

Definition at line 33 of file ut0dbg.cc.