diff options
author | unknown <serg@janus.mylan> | 2008-02-06 20:01:55 +0100 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2008-02-06 20:01:55 +0100 |
commit | 518caf1dff5c249ac52082753d155ba2c5cfd8d6 (patch) | |
tree | c8a4faae4c20432c86c3c203385ee3e93254d5f0 /dbug | |
parent | c04dd35982cd8da63de2bd0aaff0e42ab34add4e (diff) | |
download | mariadb-git-518caf1dff5c249ac52082753d155ba2c5cfd8d6.tar.gz |
dbug/dbug.c
dbug naming conventions
dbug/user.r
unification, documenting DBUG_ABORT()
include/my_dbug.h
DBUG_ABORT()
sql/mysqld.cc
remove redundant option (--enable-debug and --disable-debug should be
used instead)
dbug/dbug.c:
dbug naming conventions
dbug/user.r:
unification, documenting DBUG_ABORT()
include/my_dbug.h:
DBUG_ABORT()
sql/mysqld.cc:
remove redundant option (--enable-debug and --disable-debug should be
used instead)
Diffstat (limited to 'dbug')
-rw-r--r-- | dbug/dbug.c | 20 | ||||
-rw-r--r-- | dbug/user.r | 16 |
2 files changed, 21 insertions, 15 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 34246575cae..d6f436f5780 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -310,7 +310,7 @@ static void DoPrefix(CODE_STATE *cs, uint line); static char *DbugMalloc(size_t size); static const char *BaseName(const char *pathname); static void Indent(CODE_STATE *cs, int indent); -static void dbug_flush(CODE_STATE *); +static void DbugFlush(CODE_STATE *); static void DbugExit(const char *why); static const char *DbugStrTok(const char *s); @@ -1164,7 +1164,7 @@ void _db_enter_(const char *_func_, const char *_file_, DoPrefix(cs, _line_); Indent(cs, cs->level); (void) fprintf(cs->stack->out_file, ">%s\n", cs->func); - dbug_flush(cs); /* This does a unlock */ + DbugFlush(cs); /* This does a unlock */ break; case DISABLE_TRACE: cs->framep->level&= ~TRACE_ON; @@ -1214,7 +1214,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_MISSING_RETURN, cs->process, cs->func); - dbug_flush(cs); + DbugFlush(cs); } else { @@ -1236,7 +1236,7 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) DoPrefix(cs, _line_); Indent(cs, cs->level); (void) fprintf(cs->stack->out_file, "<%s\n", cs->func); - dbug_flush(cs); + DbugFlush(cs); } } /* @@ -1328,7 +1328,7 @@ void _db_doprnt_(const char *format,...) (void) fprintf(cs->stack->out_file, "%s: ", cs->u_keyword); (void) vfprintf(cs->stack->out_file, format, args); (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugFlush(cs); errno=save_errno; } va_end(args); @@ -1393,7 +1393,7 @@ void _db_dump_(uint _line_, const char *keyword, fputc(' ',cs->stack->out_file); } (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugFlush(cs); } } @@ -2089,7 +2089,7 @@ static void DBUGCloseFile(CODE_STATE *cs, FILE *fp) pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process); perror(""); - dbug_flush(cs); + DbugFlush(cs); } } @@ -2384,7 +2384,7 @@ char *s; /* This is because some systems (MSDOS!!) dosn't flush fileheader */ /* and dbug-file isn't readable after a system crash !! */ -static void dbug_flush(CODE_STATE *cs) +static void DbugFlush(CODE_STATE *cs) { if (cs->stack->flags & FLUSH_ON_WRITE) { @@ -2394,12 +2394,12 @@ static void dbug_flush(CODE_STATE *cs) } if (!cs->locked) pthread_mutex_unlock(&THR_LOCK_dbug); -} /* dbug_flush */ +} /* DbugFlush */ /* For debugging */ -void _db_force_flush_() +void _db_flush_() { CODE_STATE *cs; get_code_state_or_return; diff --git a/dbug/user.r b/dbug/user.r index 6cb1c05b25f..0077a4e4ad5 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -511,7 +511,7 @@ possible since all code preceding the first call to .B DBUG_PUSH is essentially invisible to -.B dbug +.I dbug (this can be worked around by inserting a temporary .B DBUG_PUSH(argv[1]) @@ -707,7 +707,7 @@ EX:\ \fCDBUG_PROCESS\ (argv[0]);\fR .SP 1 .LI DBUG_PUSH\ Sets a new debugger state by pushing the current -.B dbug +.I dbug state onto an internal stack and setting up the new state using the debug control string passed as the macro argument. The most common usage is to set the state specified by a debug control string @@ -767,14 +767,14 @@ the 'd' flag. Used to conditionally execute "dangerous" actions, e.g to crash the program testing how recovery works, or to introduce an artificial delay checking for race conditions. .SP 1 -EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ abort\ ());\fR +EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR .SP 1 .LI DBUG_EVALUATE\ The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in the expression context. The first argument is the debug keyword that is used to choose whether the second (keyword is enabled) or the third (keyword is not enabled) argument is evaluated. When -.B dbug +.I dbug is compiled off, the third argument is evaluated. .SP 1 EX:\fC @@ -794,7 +794,7 @@ EX:\fC .br if (prepare_transaction () || .br - DBUG_EVALUATE ("crashme", (abort (), 0), 0) || + DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) || .br commit_transaction () )\fR .SP 1 @@ -873,6 +873,12 @@ library. So there will be no need to disable asserts separately with NDEBUG. .SP 1 EX:\ \fCDBUG_ASSERT(\ a\ >\ 0\ );\fR .SP 1 +.LI DBUG_ABORT\ +This macro could be used instead of abort(). It flushes DBUG_FILE stream +to ensure that no +.I dbug +output is lost and then calls abort(). +.SP 1 .LI DBUG_EXPLAIN\ Generates control string corresponding to the current debug state. The macro takes two arguments - a buffer to store the result string |