mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Fixes for DBUG_ABORT()
BitKeeper/deleted/.del-.tree-is-private: Delete: .tree-is-private include/my_dbug.h: To disable the popup of abort() we use _CrtReportMode/File() (thanks Wlad) mysys/my_thr_init.c: Visual Studio 2005 does not allow overloading library functions.
This commit is contained in:
parent
8bb95a820a
commit
0954594b2d
3 changed files with 13 additions and 15 deletions
|
@ -87,7 +87,20 @@ extern void _db_flush_();
|
|||
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
|
||||
#define DEBUGGER_ON do { _dbug_on_= 1; } while(0)
|
||||
#define IF_DBUG(A) A
|
||||
#ifndef __WIN__
|
||||
#define DBUG_ABORT() (_db_flush_(), abort())
|
||||
#else
|
||||
/*
|
||||
Avoid popup with abort/retry/ignore buttons. When BUG#31745 is fixed we can
|
||||
call abort() instead of _exit(3) (now it would cause a "test signal" popup).
|
||||
*/
|
||||
#include <crtdbg.h>
|
||||
#define DBUG_ABORT() (_db_flush_(),\
|
||||
(void)_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE),\
|
||||
(void)_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR),\
|
||||
_exit(3))
|
||||
#endif
|
||||
|
||||
#else /* No debugger */
|
||||
|
||||
#define DBUG_ENTER(a1)
|
||||
|
|
|
@ -444,18 +444,3 @@ static uint get_thread_lib(void)
|
|||
}
|
||||
|
||||
#endif /* THREAD */
|
||||
|
||||
|
||||
#ifdef __WIN__
|
||||
/*
|
||||
With Windows debug builds abort() causes a popup from CRT; as abort()
|
||||
is used in tests it is annoying so we use a custom one.
|
||||
*/
|
||||
void abort(void)
|
||||
{
|
||||
#ifdef REENABLE_AFTER_FIX_FOR_BUG_31745 /* don't want a popup */
|
||||
raise(SIGABRT);
|
||||
#endif
|
||||
_exit(3);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue