Commit ec7cb94c authored by unknown's avatar unknown

ut0dbg.h, ut0dbg.c:

  Marko's patch to ut_a() fputs


innobase/ut/ut0dbg.c:
  Marko's patch to ut_a() fputs
innobase/include/ut0dbg.h:
  Marko's patch to ut_a() fputs
parent 0f6eb965
...@@ -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 {\ ut_print_timestamp(stderr);\
ulint dbg_i;\ fprintf(stderr, ut_dbg_msg_assert_fail,\
ut_print_timestamp(stderr);\ os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
fprintf(stderr,\ fprintf(stderr, ut_dbg_msg_trap);\
" InnoDB: Assertion failure in thread %lu in file %s line %lu\n",\ ut_dbg_stop_threads = TRUE;\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\ (*ut_dbg_null_ptr)++;
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 #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