summaryrefslogtreecommitdiff
path: root/dbug
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-12-22 14:16:21 +0200
committerMonty <monty@mariadb.org>2017-12-22 14:56:58 +0200
commit139e8afc2c165a08f4fa13da70b0aad3cf7b9df5 (patch)
treecf3eb4a3d2c54fc09d2e5c144d8eb7633ff6bd9a /dbug
parent1464f4808c08155fd10ba09eae2bb2c3f177482c (diff)
downloadmariadb-git-139e8afc2c165a08f4fa13da70b0aad3cf7b9df5.tar.gz
Re-enable 'S' for --debug (sf_sanity checking for each call)
- Fixed also a wrong comment and a wrong argument to printf
Diffstat (limited to 'dbug')
-rw-r--r--dbug/dbug.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c
index e4125a3efea..dedc455147b 100644
--- a/dbug/dbug.c
+++ b/dbug/dbug.c
@@ -128,7 +128,6 @@
#define SANITY_CHECK_ON (1U << 12) /* Check memory on every DBUG_ENTER/RETURN */
#define TRACE_ON (1U << 31) /* Trace enabled. MUST be the highest bit!*/
-#define sf_sanity() (0)
#define TRACING (cs->stack->flags & TRACE_ON)
#define DEBUGGING (cs->stack->flags & DEBUG_ON)
@@ -272,6 +271,11 @@ static void PushState(CODE_STATE *cs);
static void FreeState (CODE_STATE *cs, int free_state);
/* Test for tracing enabled */
static int DoTrace(CODE_STATE *cs);
+static int default_my_dbug_sanity(void);
+
+int (*dbug_sanity)(void)= default_my_dbug_sanity;
+
+
/*
return values of DoTrace.
Can also be used as bitmask: ret & DO_TRACE
@@ -1121,7 +1125,7 @@ void _db_enter_(const char *_func_, const char *_file_,
if (!TRACING) break;
/* fall through */
case DO_TRACE:
- if ((cs->stack->flags & SANITY_CHECK_ON) && sf_sanity())
+ if ((cs->stack->flags & SANITY_CHECK_ON) && (*dbug_sanity)())
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
@@ -1190,7 +1194,7 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)
if (DoTrace(cs) & DO_TRACE)
{
int org_cs_locked;
- if ((cs->stack->flags & SANITY_CHECK_ON) && sf_sanity())
+ if ((cs->stack->flags & SANITY_CHECK_ON) && (*dbug_sanity)())
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
@@ -2248,6 +2252,12 @@ const char* _db_get_func_(void)
return cs->func;
}
+
+static int default_my_dbug_sanity(void)
+{
+ return 0;
+}
+
#else
/*