InnoDB Plugin  1.0
Macros | Functions | Variables
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 UT_DBG_FAIL(EXPR)   !((ulint)(EXPR) + ut_dbg_zero)
#define UT_DBG_PANIC   abort()
#define ut_a(EXPR)
#define ut_error
#define ut_ad(EXPR)   ut_a(EXPR)
#define ut_d(EXPR)   do {EXPR;} while (0)
#define UT_NOT_USED(A)   A = A

Functions

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

Variables

ulint ut_dbg_zero

Detailed Description

Debug utilities for Innobase

Created 1/30/1994 Heikki Tuuri

Macro Definition Documentation

#define ut_a (   EXPR)
Value:
do { \
if (UT_DBG_FAIL(EXPR)) { \
ut_dbg_assertion_failed(#EXPR, \
__FILE__, (ulint) __LINE__); \
UT_DBG_PANIC; \
} \
} while (0)
Abort execution if EXPR does not evaluate to nonzero.
Parameters
EXPRassertion expression that should hold
#define ut_ad (   EXPR)    ut_a(EXPR)

Debug assertion. Does nothing unless UNIV_DEBUG is defined.

#define ut_d (   EXPR)    do {EXPR;} while (0)

Debug statement. Does nothing unless UNIV_DEBUG is defined.

#define UT_DBG_FAIL (   EXPR)    !((ulint)(EXPR) + ut_dbg_zero)
Test if an assertion fails.
Parameters
EXPRassertion expression
Returns
nonzero if EXPR holds, zero if not
#define UT_DBG_PANIC   abort()

Abort the execution.

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

Abort execution.

#define UT_NOT_USED (   A)    A = A
Silence warnings about an unused variable by doing a null assignment.
Parameters
Athe unused variable

Function Documentation

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

Report a failed assertion.

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

Variable Documentation

ulint ut_dbg_zero

This is used to eliminate compiler warnings