Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/mysql/server
File: my_dbug.h
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates.
[0] Fix | Delete
Copyright (C) 2000, 2019, MariaDB Corporation.
[1] Fix | Delete
[2] Fix | Delete
This program is free software; you can redistribute it and/or modify
[3] Fix | Delete
it under the terms of the GNU General Public License as published by
[4] Fix | Delete
the Free Software Foundation; version 2 of the License.
[5] Fix | Delete
[6] Fix | Delete
This program is distributed in the hope that it will be useful,
[7] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[8] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[9] Fix | Delete
GNU General Public License for more details.
[10] Fix | Delete
[11] Fix | Delete
You should have received a copy of the GNU General Public License
[12] Fix | Delete
along with this program; if not, write to the Free Software
[13] Fix | Delete
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
[14] Fix | Delete
[15] Fix | Delete
#ifndef _my_dbug_h
[16] Fix | Delete
#define _my_dbug_h
[17] Fix | Delete
[18] Fix | Delete
#ifndef _WIN32
[19] Fix | Delete
#include <signal.h>
[20] Fix | Delete
#endif
[21] Fix | Delete
[22] Fix | Delete
#ifdef __cplusplus
[23] Fix | Delete
extern "C" {
[24] Fix | Delete
#endif
[25] Fix | Delete
#if !defined(DBUG_OFF) && !defined(_lint)
[26] Fix | Delete
[27] Fix | Delete
struct _db_stack_frame_ {
[28] Fix | Delete
const char *func; /* function name of the previous stack frame */
[29] Fix | Delete
const char *file; /* filename of the function of previous frame */
[30] Fix | Delete
uint level; /* this nesting level, highest bit enables tracing */
[31] Fix | Delete
int line; /* line of DBUG_RETURN */
[32] Fix | Delete
struct _db_stack_frame_ *prev; /* pointer to the previous frame */
[33] Fix | Delete
};
[34] Fix | Delete
[35] Fix | Delete
struct _db_code_state_;
[36] Fix | Delete
extern my_bool _dbug_on_;
[37] Fix | Delete
extern my_bool _db_keyword_(struct _db_code_state_ *, const char *, int);
[38] Fix | Delete
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
[39] Fix | Delete
extern int _db_explain_init_(char *buf, size_t len);
[40] Fix | Delete
extern int _db_is_pushed_(void);
[41] Fix | Delete
extern void _db_setjmp_(void);
[42] Fix | Delete
extern void _db_longjmp_(void);
[43] Fix | Delete
extern void _db_process_(const char *name);
[44] Fix | Delete
extern void _db_push_(const char *control);
[45] Fix | Delete
extern void _db_pop_(void);
[46] Fix | Delete
extern void _db_set_(const char *control);
[47] Fix | Delete
extern void _db_set_init_(const char *control);
[48] Fix | Delete
extern void _db_enter_(const char *_func_, const char *_file_, uint _line_,
[49] Fix | Delete
struct _db_stack_frame_ *_stack_frame_);
[50] Fix | Delete
extern void _db_return_(struct _db_stack_frame_ *_stack_frame_);
[51] Fix | Delete
extern int _db_pargs_(uint _line_,const char *keyword);
[52] Fix | Delete
extern void _db_doprnt_(const char *format,...)
[53] Fix | Delete
#ifdef WAITING_FOR_BUGFIX_TO_VSPRINTF
[54] Fix | Delete
ATTRIBUTE_FORMAT(printf, 1, 2)
[55] Fix | Delete
#endif
[56] Fix | Delete
;
[57] Fix | Delete
extern void _db_dump_(uint _line_,const char *keyword,
[58] Fix | Delete
const unsigned char *memory, size_t length);
[59] Fix | Delete
extern void _db_end_(void);
[60] Fix | Delete
extern void _db_lock_file_(void);
[61] Fix | Delete
extern void _db_unlock_file_(void);
[62] Fix | Delete
ATTRIBUTE_COLD
[63] Fix | Delete
extern my_bool _db_my_assert(const char *file, int line, const char *msg);
[64] Fix | Delete
extern FILE *_db_fp_(void);
[65] Fix | Delete
extern void _db_flush_(void);
[66] Fix | Delete
extern void dbug_swap_code_state(void **code_state_store);
[67] Fix | Delete
extern void dbug_free_code_state(void **code_state_store);
[68] Fix | Delete
extern const char* _db_get_func_(void);
[69] Fix | Delete
extern int (*dbug_sanity)(void);
[70] Fix | Delete
[71] Fix | Delete
#ifdef DBUG_TRACE
[72] Fix | Delete
#define DBUG_LEAVE do { \
[73] Fix | Delete
_db_stack_frame_.line= __LINE__; \
[74] Fix | Delete
_db_return_ (&_db_stack_frame_); \
[75] Fix | Delete
_db_stack_frame_.line= 0; \
[76] Fix | Delete
} while(0)
[77] Fix | Delete
[78] Fix | Delete
#define DBUG_PRINT(keyword,arglist) \
[79] Fix | Delete
do if (_db_pargs_(__LINE__,keyword)) _db_doprnt_ arglist; while(0)
[80] Fix | Delete
[81] Fix | Delete
#ifdef HAVE_ATTRIBUTE_CLEANUP
[82] Fix | Delete
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_ __attribute__((cleanup(_db_return_))); \
[83] Fix | Delete
_db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
[84] Fix | Delete
#define DBUG_RETURN(a1) do { _db_stack_frame_.line=__LINE__; return(a1);} while(0)
[85] Fix | Delete
#define DBUG_VOID_RETURN do { _db_stack_frame_.line=__LINE__; return;} while(0)
[86] Fix | Delete
#else
[87] Fix | Delete
#define DBUG_ENTER(a) struct _db_stack_frame_ _db_stack_frame_; \
[88] Fix | Delete
_db_enter_ (a,__FILE__,__LINE__,&_db_stack_frame_)
[89] Fix | Delete
#define DBUG_RETURN(a1) do {DBUG_LEAVE; return(a1);} while(0)
[90] Fix | Delete
#define DBUG_VOID_RETURN do {DBUG_LEAVE; return;} while(0)
[91] Fix | Delete
#endif
[92] Fix | Delete
[93] Fix | Delete
#else
[94] Fix | Delete
#define DBUG_LEAVE
[95] Fix | Delete
#define DBUG_ENTER(a)
[96] Fix | Delete
#define DBUG_RETURN(a1) return(a1)
[97] Fix | Delete
#define DBUG_VOID_RETURN return
[98] Fix | Delete
#define DBUG_PRINT(keyword,arglist) do{} while(0)
[99] Fix | Delete
#endif
[100] Fix | Delete
[101] Fix | Delete
#define DBUG_EXECUTE(keyword,a1) \
[102] Fix | Delete
do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0)
[103] Fix | Delete
#define DBUG_EXECUTE_IF(keyword,a1) \
[104] Fix | Delete
do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0)
[105] Fix | Delete
#define DBUG_EVALUATE(keyword,a1,a2) \
[106] Fix | Delete
(_db_keyword_(0,(keyword), 0) ? (a1) : (a2))
[107] Fix | Delete
#define DBUG_EVALUATE_IF(keyword,a1,a2) \
[108] Fix | Delete
(_db_keyword_(0,(keyword), 1) ? (a1) : (a2))
[109] Fix | Delete
#define DBUG_PUSH_EMPTY if (_dbug_on_) { DBUG_PUSH(""); }
[110] Fix | Delete
#define DBUG_POP_EMPTY if (_dbug_on_) { DBUG_POP(); }
[111] Fix | Delete
#define DBUG_PUSH(a1) _db_push_ (a1)
[112] Fix | Delete
#define DBUG_POP() _db_pop_ ()
[113] Fix | Delete
#define DBUG_SET(a1) _db_set_ (a1)
[114] Fix | Delete
#define DBUG_SET_INITIAL(a1) _db_set_init_ (a1)
[115] Fix | Delete
#define DBUG_PROCESS(a1) _db_process_(a1)
[116] Fix | Delete
#define DBUG_FILE _db_fp_()
[117] Fix | Delete
#define DBUG_DUMP(keyword,a1,a2) _db_dump_(__LINE__,keyword,a1,a2)
[118] Fix | Delete
#define DBUG_END() _db_end_ ()
[119] Fix | Delete
#define DBUG_LOCK_FILE _db_lock_file_()
[120] Fix | Delete
#define DBUG_UNLOCK_FILE _db_unlock_file_()
[121] Fix | Delete
#define DBUG_ASSERT(A) do { \
[122] Fix | Delete
if (unlikely(!(A)) && _db_my_assert(__FILE__, __LINE__, #A)) assert(A); \
[123] Fix | Delete
} while (0)
[124] Fix | Delete
#define DBUG_SLOW_ASSERT(A) DBUG_ASSERT(A)
[125] Fix | Delete
#define DBUG_ASSERT_EXISTS
[126] Fix | Delete
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
[127] Fix | Delete
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
[128] Fix | Delete
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
[129] Fix | Delete
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
[130] Fix | Delete
#define IF_DBUG(A,B) A
[131] Fix | Delete
#define IF_DBUG_ASSERT(A,B) A
[132] Fix | Delete
#define DBUG_SWAP_CODE_STATE(arg) dbug_swap_code_state(arg)
[133] Fix | Delete
#define DBUG_FREE_CODE_STATE(arg) dbug_free_code_state(arg)
[134] Fix | Delete
#undef DBUG_ASSERT_AS_PRINTF
[135] Fix | Delete
[136] Fix | Delete
#ifndef _WIN32
[137] Fix | Delete
#define DBUG_ABORT() (_db_flush_(), abort())
[138] Fix | Delete
#else
[139] Fix | Delete
/*
[140] Fix | Delete
Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
[141] Fix | Delete
call abort() instead of _exit(3) (now it would cause a "test signal" popup).
[142] Fix | Delete
*/
[143] Fix | Delete
#include <crtdbg.h>
[144] Fix | Delete
#define DBUG_ABORT() (_db_flush_(),\
[145] Fix | Delete
(void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
[146] Fix | Delete
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
[147] Fix | Delete
TerminateProcess(GetCurrentProcess(),3))
[148] Fix | Delete
#endif
[149] Fix | Delete
[150] Fix | Delete
/*
[151] Fix | Delete
Make the program fail, without creating a core file.
[152] Fix | Delete
abort() will send SIGABRT which (most likely) generates core.
[153] Fix | Delete
Use SIGKILL instead, which cannot be caught.
[154] Fix | Delete
We also pause the current thread, until the signal is actually delivered.
[155] Fix | Delete
An alternative would be to use _exit(EXIT_FAILURE),
[156] Fix | Delete
but then valgrind would report lots of memory leaks.
[157] Fix | Delete
*/
[158] Fix | Delete
#ifdef _WIN32
[159] Fix | Delete
#define DBUG_SUICIDE() DBUG_ABORT()
[160] Fix | Delete
#else
[161] Fix | Delete
extern void _db_suicide_(void);
[162] Fix | Delete
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
[163] Fix | Delete
#endif /* _WIN32 */
[164] Fix | Delete
[165] Fix | Delete
#else /* No debugger */
[166] Fix | Delete
[167] Fix | Delete
#define DBUG_ENTER(a1)
[168] Fix | Delete
#define DBUG_VIOLATION_HELPER_LEAVE do { } while(0)
[169] Fix | Delete
#define DBUG_LEAVE
[170] Fix | Delete
#define DBUG_RETURN(a1) do { return(a1); } while(0)
[171] Fix | Delete
#define DBUG_VOID_RETURN do { return; } while(0)
[172] Fix | Delete
#define DBUG_PRINT(keyword, arglist) do { } while(0)
[173] Fix | Delete
#define DBUG_EXECUTE(keyword,a1) do { } while(0)
[174] Fix | Delete
#define DBUG_EXECUTE_IF(keyword,a1) do { } while(0)
[175] Fix | Delete
#define DBUG_EVALUATE(keyword,a1,a2) (a2)
[176] Fix | Delete
#define DBUG_EVALUATE_IF(keyword,a1,a2) (a2)
[177] Fix | Delete
#define DBUG_PRINT(keyword,arglist) do { } while(0)
[178] Fix | Delete
#define DBUG_PUSH_EMPTY do { } while(0)
[179] Fix | Delete
#define DBUG_POP_EMPTY do { } while(0)
[180] Fix | Delete
#define DBUG_PUSH(a1) do { } while(0)
[181] Fix | Delete
#define DBUG_SET(a1) do { } while(0)
[182] Fix | Delete
#define DBUG_SET_INITIAL(a1) do { } while(0)
[183] Fix | Delete
#define DBUG_POP() do { } while(0)
[184] Fix | Delete
#define DBUG_PROCESS(a1) do { } while(0)
[185] Fix | Delete
#define DBUG_DUMP(keyword,a1,a2) do { } while(0)
[186] Fix | Delete
#define DBUG_END() do { } while(0)
[187] Fix | Delete
#define DBUG_SLOW_ASSERT(A) do { } while(0)
[188] Fix | Delete
#define DBUG_LOCK_FILE do { } while(0)
[189] Fix | Delete
#define DBUG_FILE (stderr)
[190] Fix | Delete
#define DBUG_UNLOCK_FILE do { } while(0)
[191] Fix | Delete
#define DBUG_EXPLAIN(buf,len)
[192] Fix | Delete
#define DBUG_EXPLAIN_INITIAL(buf,len)
[193] Fix | Delete
#define DEBUGGER_OFF do { } while(0)
[194] Fix | Delete
#define DEBUGGER_ON do { } while(0)
[195] Fix | Delete
#define IF_DBUG(A,B) B
[196] Fix | Delete
#define DBUG_SWAP_CODE_STATE(arg) do { } while(0)
[197] Fix | Delete
#define DBUG_FREE_CODE_STATE(arg) do { } while(0)
[198] Fix | Delete
#define DBUG_ABORT() do { } while(0)
[199] Fix | Delete
#define DBUG_CRASH_ENTER(func)
[200] Fix | Delete
#define DBUG_CRASH_RETURN(val) do { return(val); } while(0)
[201] Fix | Delete
#define DBUG_CRASH_VOID_RETURN do { return; } while(0)
[202] Fix | Delete
#define DBUG_SUICIDE() do { } while(0)
[203] Fix | Delete
[204] Fix | Delete
#ifdef DBUG_ASSERT_AS_PRINTF
[205] Fix | Delete
extern void (*my_dbug_assert_failed)(const char *assert_expr, const char* file, unsigned long line);
[206] Fix | Delete
#define DBUG_ASSERT(assert_expr) do { if (!(assert_expr)) { my_dbug_assert_failed(#assert_expr, __FILE__, __LINE__); }} while (0)
[207] Fix | Delete
#define DBUG_ASSERT_EXISTS
[208] Fix | Delete
#define IF_DBUG_ASSERT(A,B) A
[209] Fix | Delete
#else
[210] Fix | Delete
#define DBUG_ASSERT(A) do { } while(0)
[211] Fix | Delete
#define IF_DBUG_ASSERT(A,B) B
[212] Fix | Delete
#endif /* DBUG_ASSERT_AS_PRINTF */
[213] Fix | Delete
#endif /* !defined(DBUG_OFF) && !defined(_lint) */
[214] Fix | Delete
[215] Fix | Delete
#ifdef EXTRA_DEBUG
[216] Fix | Delete
/**
[217] Fix | Delete
Sync points allow us to force the server to reach a certain line of code
[218] Fix | Delete
and block there until the client tells the server it is ok to go on.
[219] Fix | Delete
The client tells the server to block with SELECT GET_LOCK()
[220] Fix | Delete
and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult
[221] Fix | Delete
concurrency problems
[222] Fix | Delete
*/
[223] Fix | Delete
#define DBUG_SYNC_POINT(lock_name,lock_timeout) \
[224] Fix | Delete
debug_sync_point(lock_name,lock_timeout)
[225] Fix | Delete
void debug_sync_point(const char* lock_name, uint lock_timeout);
[226] Fix | Delete
#else
[227] Fix | Delete
#define DBUG_SYNC_POINT(lock_name,lock_timeout)
[228] Fix | Delete
#endif /* EXTRA_DEBUG */
[229] Fix | Delete
[230] Fix | Delete
#ifdef __cplusplus
[231] Fix | Delete
}
[232] Fix | Delete
/*
[233] Fix | Delete
DBUG_LOG() was initially intended for InnoDB. To be able to use it elsewhere
[234] Fix | Delete
one should #include <sstream>. We intentionally avoid including it here to save
[235] Fix | Delete
compilation time.
[236] Fix | Delete
*/
[237] Fix | Delete
# ifdef DBUG_OFF
[238] Fix | Delete
# define DBUG_LOG(keyword, v) do {} while (0)
[239] Fix | Delete
# else
[240] Fix | Delete
# define DBUG_LOG(keyword, v) do { \
[241] Fix | Delete
if (_db_pargs_(__LINE__, keyword)) { \
[242] Fix | Delete
std::ostringstream _db_s; _db_s << v; \
[243] Fix | Delete
_db_doprnt_("%s", _db_s.str().c_str()); \
[244] Fix | Delete
}} while (0)
[245] Fix | Delete
# endif
[246] Fix | Delete
#endif
[247] Fix | Delete
[248] Fix | Delete
#endif /* _my_dbug_h */
[249] Fix | Delete
[250] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function