mariadb/innobase/include/ut0dbg.h
unknown a3edc742b9 Many files:
Merge InnoDB-3.23.52d


innobase/btr/btr0sea.c:
  Merge InnoDB-3.23.52d
innobase/buf/buf0buf.c:
  Merge InnoDB-3.23.52d
innobase/buf/buf0lru.c:
  Merge InnoDB-3.23.52d
innobase/include/buf0buf.h:
  Merge InnoDB-3.23.52d
innobase/include/ha0ha.h:
  Merge InnoDB-3.23.52d
innobase/include/log0log.h:
  Merge InnoDB-3.23.52d
innobase/include/os0file.h:
  Merge InnoDB-3.23.52d
innobase/include/os0thread.h:
  Merge InnoDB-3.23.52d
innobase/include/ha0ha.ic:
  Merge InnoDB-3.23.52d
innobase/include/os0sync.ic:
  Merge InnoDB-3.23.52d
innobase/include/srv0start.h:
  Merge InnoDB-3.23.52d
innobase/include/sync0rw.ic:
  Merge InnoDB-3.23.52d
innobase/include/sync0sync.ic:
  Merge InnoDB-3.23.52d
innobase/include/ut0dbg.h:
  Merge InnoDB-3.23.52d
innobase/include/univ.i:
  Merge InnoDB-3.23.52d
innobase/lock/lock0lock.c:
  Merge InnoDB-3.23.52d
innobase/log/log0log.c:
  Merge InnoDB-3.23.52d
innobase/mem/mem0pool.c:
  Merge InnoDB-3.23.52d
innobase/os/os0file.c:
  Merge InnoDB-3.23.52d
innobase/os/os0thread.c:
  Merge InnoDB-3.23.52d
innobase/srv/srv0srv.c:
  Merge InnoDB-3.23.52d
innobase/srv/srv0start.c:
  Merge InnoDB-3.23.52d
innobase/sync/sync0arr.c:
  Merge InnoDB-3.23.52d
innobase/sync/sync0rw.c:
  Merge InnoDB-3.23.52d
innobase/sync/sync0sync.c:
  Merge InnoDB-3.23.52d
innobase/thr/thr0loc.c:
  Merge InnoDB-3.23.52d
innobase/trx/trx0trx.c:
  Merge InnoDB-3.23.52d
innobase/configure.in:
  Merge InnoDB-3.23.52d
sql/ha_innobase.cc:
  Merge InnoDB-3.23.52d
2002-08-06 22:59:13 +03:00

85 lines
2 KiB
C

/*********************************************************************
Debug utilities for Innobase
(c) 1994, 1995 Innobase Oy
Created 1/30/1994 Heikki Tuuri
**********************************************************************/
#ifndef ut0dbg_h
#define ut0dbg_h
#include "univ.i"
#include <assert.h>
#include <stdlib.h>
#include "os0thread.h"
extern ulint ut_dbg_zero; /* This is used to eliminate
compiler warnings */
extern ibool ut_dbg_stop_threads;
extern ulint* ut_dbg_null_ptr;
#define ut_a(EXPR)\
{\
ulint dbg_i;\
\
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\
fprintf(stderr,\
" InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
(ulint)__LINE__);\
fprintf(stderr,\
"InnoDB: We intentionally generate a memory trap.\n");\
fprintf(stderr,\
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n");\
ut_dbg_stop_threads = TRUE;\
dbg_i = *(ut_dbg_null_ptr);\
if (dbg_i) {\
ut_dbg_null_ptr = NULL;\
}\
}\
if (ut_dbg_stop_threads) {\
fprintf(stderr,\
"InnoDB: Thread %lu stopped in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
}\
}
#define ut_error {\
ulint dbg_i;\
ut_print_timestamp(stderr);\
fprintf(stderr,\
" InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
fprintf(stderr,\
"InnoDB: We intentionally generate a memory trap.\n");\
fprintf(stderr,\
"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n");\
ut_dbg_stop_threads = TRUE;\
dbg_i = *(ut_dbg_null_ptr);\
printf("%lu", dbg_i);\
}
#ifdef UNIV_DEBUG
#define ut_ad(EXPR) ut_a(EXPR)
#define ut_d(EXPR) {EXPR;}
#else
#define ut_ad(EXPR)
#define ut_d(EXPR)
#endif
#define UT_NOT_USED(A) A = A
#endif