ut0dbg.h, ut0dbg.c:

  Marko's patch to ut_a() fputs
parent aa2869a3
...@@ -20,50 +20,34 @@ extern ibool ut_dbg_stop_threads; ...@@ -20,50 +20,34 @@ extern ibool ut_dbg_stop_threads;
extern ulint* ut_dbg_null_ptr; extern ulint* ut_dbg_null_ptr;
extern const char* ut_dbg_msg_assert_fail;
extern const char* ut_dbg_msg_trap;
extern const char* ut_dbg_msg_stop;
#define ut_a(EXPR)\ #define ut_a(EXPR)\
{\
ulint dbg_i;\
\
if (!((ulint)(EXPR) + ut_dbg_zero)) {\ if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\ ut_print_timestamp(stderr);\
fprintf(stderr,\ fprintf(stderr, ut_dbg_msg_assert_fail,\
" InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__,\
(ulint)__LINE__);\ (ulint)__LINE__);\
fputs(\ fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
"InnoDB: Failing assertion: " #EXPR, stderr);\ fputs(ut_dbg_msg_trap, stderr);\
fprintf(stderr,\
"\nInnoDB: 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;\ ut_dbg_stop_threads = TRUE;\
dbg_i = *(ut_dbg_null_ptr);\ (*ut_dbg_null_ptr)++;\
if (dbg_i) {\
ut_dbg_null_ptr = NULL;\
}\
}\ }\
if (ut_dbg_stop_threads) {\ if (ut_dbg_stop_threads) {\
fprintf(stderr,\ fprintf(stderr, ut_dbg_msg_stop,\
"InnoDB: Thread %lu stopped in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\ os_thread_sleep(1000000000);\
}\ }
}
#define ut_error {\ #define ut_error\
ulint dbg_i;\
ut_print_timestamp(stderr);\ ut_print_timestamp(stderr);\
fprintf(stderr,\ fprintf(stderr, ut_dbg_msg_assert_fail,\
" InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
fprintf(stderr,\ fprintf(stderr, ut_dbg_msg_trap);\
"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;\ ut_dbg_stop_threads = TRUE;\
dbg_i = *(ut_dbg_null_ptr);\ (*ut_dbg_null_ptr)++;
printf("%lu", dbg_i);\
}
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
#define ut_ad(EXPR) ut_a(EXPR) #define ut_ad(EXPR) ut_a(EXPR)
......
...@@ -19,9 +19,10 @@ ibool ut_dbg_stop_threads = FALSE; ...@@ -19,9 +19,10 @@ ibool ut_dbg_stop_threads = FALSE;
ulint* ut_dbg_null_ptr = NULL; ulint* ut_dbg_null_ptr = NULL;
/* Dummy function to prevent gcc from ignoring this file */ const char* ut_dbg_msg_assert_fail =
void "InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
ut_dummy(void) const char* ut_dbg_msg_trap =
{ "InnoDB: We intentionally generate a memory trap.\n"
printf("Hello world\n"); "InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n";
} const char* ut_dbg_msg_stop =
"InnoDB: Thread %lu stopped in file %s line %lu\n";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment