#include <stdlib.h>
#include "my_compiler.h"
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <sstream>
#include <string>
 
Go to the source code of this file.
 | 
| #define  | DBUG_PRETTY_FUNCTION   __func__ | 
|   | 
| #define  | DBUG_TRACE     const AutoDebugTrace _db_trace(DBUG_PRETTY_FUNCTION, __FILE__, __LINE__) | 
|   | 
| #define  | DBUG_ENTER(a) | 
|   | 
| #define  | DBUG_RETURN(a1) | 
|   | 
| #define  | DBUG_VOID_RETURN | 
|   | 
| #define  | DBUG_EXECUTE(keyword,  a1) | 
|   | 
| #define  | DBUG_EXECUTE_IF(keyword,  a1) | 
|   | 
| #define  | DBUG_EVALUATE(keyword,  a1,  a2)     (_db_keyword_(0, (keyword), 0) ? (a1) : (a2)) | 
|   | 
| #define  | DBUG_EVALUATE_IF(keyword,  a1,  a2)     (_db_keyword_(0, (keyword), 1) ? (a1) : (a2)) | 
|   | 
| #define  | DBUG_PRINT(keyword,  arglist) | 
|   | 
| #define  | DBUG_PUSH(a1)   _db_push_(a1) | 
|   | 
| #define  | DBUG_POP()   _db_pop_() | 
|   | 
| #define  | DBUG_SET(a1)   _db_set_(a1) | 
|   | 
| #define  | DBUG_SET_INITIAL(a1)   _db_set_init_(a1) | 
|   | 
| #define  | DBUG_PROCESS(a1)   _db_process_(a1) | 
|   | 
| #define  | DBUG_FILE   _db_fp_() | 
|   | 
| #define  | DBUG_DUMP(keyword,  a1,  a2)   _db_dump_(__LINE__, keyword, a1, a2) | 
|   | 
| #define  | DBUG_END()   _db_end_() | 
|   | 
| #define  | DBUG_LOCK_FILE   _db_lock_file_() | 
|   | 
| #define  | DBUG_UNLOCK_FILE   _db_unlock_file_() | 
|   | 
| #define  | DBUG_EXPLAIN(buf,  len)   _db_explain_(0, (buf), (len)) | 
|   | 
| #define  | DBUG_EXPLAIN_INITIAL(buf,  len)   _db_explain_init_((buf), (len)) | 
|   | 
| #define  | DBUG_ABORT()   (_db_flush_(), my_abort()) | 
|   | 
| #define  | DBUG_EXIT()   (_db_flush_(), exit(2)) | 
|   | 
| #define  | DBUG_SUICIDE()   (_db_flush_(), _db_suicide_()) | 
|   | 
| #define  | DBUG_LOG(keyword,  v) | 
|   | 
| #define  | DBUG_VAR(v)   #v << "=[" << (v) << "]" | 
|   | Shortcut for printing a variable name and its value in DBUG_LOG output.  More...
  | 
|   | 
 | 
| void  | my_abort () | 
|   | Calls our own implementation of abort, if specified, or std's abort().  More...
  | 
|   | 
| void  | set_my_abort (void(*new_my_abort_func)()) | 
|   | Sets a new function to be called on my_abort().  More...
  | 
|   | 
| int  | _db_keyword_ (struct CODE_STATE *, const char *, int) | 
|   | 
| int  | _db_explain_ (struct CODE_STATE *cs, char *buf, size_t len) | 
|   | 
| int  | _db_explain_init_ (char *buf, size_t len) | 
|   | 
| int  | _db_is_pushed_ (void) | 
|   | Returns true if session-local settings have been set.  More...
  | 
|   | 
| void  | _db_process_ (const char *name) | 
|   | 
| void  | _db_push_ (const char *control) | 
|   | 
| void  | _db_pop_ (void) | 
|   | 
| void  | _db_set_ (const char *control) | 
|   | 
| void  | _db_set_init_ (const char *control) | 
|   | 
| void  | _db_enter_ (const char *_func_, int func_len, const char *_file_, unsigned int _line_, struct _db_stack_frame_ *_stack_frame_) | 
|   | 
| void  | _db_return_ (unsigned int _line_, struct _db_stack_frame_ *_stack_frame_) | 
|   | 
| void  | _db_pargs_ (unsigned int _line_, const char *keyword) | 
|   | 
| int  | _db_enabled_ () | 
|   | 
| void  | _db_doprnt_ (const char *format,...) | 
|   | 
| void  | _db_dump_ (unsigned int _line_, const char *keyword, const unsigned char *memory, size_t length) | 
|   | 
| void  | _db_end_ (void) | 
|   | 
| void  | _db_lock_file_ (void) | 
|   | 
| void  | _db_unlock_file_ (void) | 
|   | 
| FILE *  | _db_fp_ (void) | 
|   | 
| void  | _db_flush_ () | 
|   | 
| void  | _db_suicide_ () | 
|   | 
| void  | _db_flush_gcov_ () | 
|   | 
| template<class DBGCLOS >  | 
| void  | dbug (const char *keyword, DBGCLOS &&clos) | 
|   | A type-safe interface to DBUG_EXECUTE_IF, where the debug action to activate when the keyword is provided is given as a callable object (typically a lambda).  More...
  | 
|   | 
◆ DBUG_ABORT
◆ DBUG_DUMP
      
        
          | #define DBUG_DUMP | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          a1,  | 
        
        
           | 
           | 
            | 
          a2  | 
        
        
           | 
          ) | 
           |    _db_dump_(__LINE__, keyword, a1, a2) | 
        
      
 
 
◆ DBUG_END
◆ DBUG_ENTER
◆ DBUG_EVALUATE
      
        
          | #define DBUG_EVALUATE | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          a1,  | 
        
        
           | 
           | 
            | 
          a2  | 
        
        
           | 
          ) | 
           |      (_db_keyword_(0, (keyword), 0) ? (a1) : (a2)) | 
        
      
 
 
◆ DBUG_EVALUATE_IF
      
        
          | #define DBUG_EVALUATE_IF | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          a1,  | 
        
        
           | 
           | 
            | 
          a2  | 
        
        
           | 
          ) | 
           |      (_db_keyword_(0, (keyword), 1) ? (a1) : (a2)) | 
        
      
 
 
◆ DBUG_EXECUTE
      
        
          | #define DBUG_EXECUTE | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          a1  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:  do {                                   \
      a1                                 \
    }                                    \
  } while (0)
int _db_keyword_(struct CODE_STATE *, const char *, int)
Definition: dbug.cc:1759
 
 
 
 
◆ DBUG_EXECUTE_IF
      
        
          | #define DBUG_EXECUTE_IF | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          a1  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:  do {                                   \
      a1                                 \
    }                                    \
  } while (0)
 
 
 
◆ DBUG_EXIT
◆ DBUG_EXPLAIN
      
        
          | #define DBUG_EXPLAIN | 
          ( | 
            | 
          buf,  | 
        
        
           | 
           | 
            | 
          len  | 
        
        
           | 
          ) | 
           |    _db_explain_(0, (buf), (len)) | 
        
      
 
 
◆ DBUG_EXPLAIN_INITIAL
◆ DBUG_FILE
◆ DBUG_LOCK_FILE
◆ DBUG_LOG
      
        
          | #define DBUG_LOG | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          v  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:  do {                                                 \
    _db_pargs_(__LINE__, keyword);                     \
      sout << v;                                       \
      DBUG_PRINT(keyword, ("%s", sout.str().c_str())); \
    }                                                  \
  } while (0)
int _db_enabled_()
Definition: dbug.cc:1276
 
std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > > ostringstream
Specialization of basic_ostringstream which uses ut::allocator.
Definition: ut0new.h:2875
 
 
 
 
◆ DBUG_POP
◆ DBUG_PRETTY_FUNCTION
      
        
          | #define DBUG_PRETTY_FUNCTION   __func__ | 
        
      
 
 
◆ DBUG_PRINT
      
        
          | #define DBUG_PRINT | 
          ( | 
            | 
          keyword,  | 
        
        
           | 
           | 
            | 
          arglist  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Value:  do {                               \
    _db_pargs_(__LINE__, keyword);   \
      _db_doprnt_ arglist;           \
    }                                \
  } while (0)
 
 
 
◆ DBUG_PROCESS
◆ DBUG_PUSH
◆ DBUG_RETURN
      
        
          | #define DBUG_RETURN | 
          ( | 
            | 
          a1 | ) | 
           | 
        
      
 
Value:  do {                                        \
    return (a1);                              \
  } while (0)
 
 
 
◆ DBUG_SET
◆ DBUG_SET_INITIAL
◆ DBUG_SUICIDE
◆ DBUG_TRACE
◆ DBUG_UNLOCK_FILE
◆ DBUG_VAR
      
        
          | #define DBUG_VAR | 
          ( | 
            | 
          v | ) | 
             #v << "=[" << (v) << "]" | 
        
      
 
Shortcut for printing a variable name and its value in DBUG_LOG output. 
Use like:
DBUG_LOG("info", DBUG_VAR(i) << " " << DBUG_VAR(thd->query));
Example output for the above might be:
i=[4711] thd->query=[INSERT INTO t VALUES (1)] 
 
 
◆ DBUG_VOID_RETURN
Value:  do {                                        \
    return;                                   \
  } while (0)
 
 
 
◆ _db_doprnt_()
      
        
          | void _db_doprnt_  | 
          ( | 
          const char *  | 
          format,  | 
        
        
           | 
           | 
            | 
          ...  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_dump_()
      
        
          | void _db_dump_  | 
          ( | 
          unsigned int  | 
          _line_,  | 
        
        
           | 
           | 
          const char *  | 
          keyword,  | 
        
        
           | 
           | 
          const unsigned char *  | 
          memory,  | 
        
        
           | 
           | 
          size_t  | 
          length  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_enabled_()
◆ _db_end_()
◆ _db_enter_()
      
        
          | void _db_enter_  | 
          ( | 
          const char *  | 
          _func_,  | 
        
        
           | 
           | 
          int  | 
          func_len,  | 
        
        
           | 
           | 
          const char *  | 
          _file_,  | 
        
        
           | 
           | 
          unsigned int  | 
          _line_,  | 
        
        
           | 
           | 
          struct _db_stack_frame_ *  | 
          _stack_frame_  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_explain_()
      
        
          | int _db_explain_  | 
          ( | 
          struct CODE_STATE *  | 
          cs,  | 
        
        
           | 
           | 
          char *  | 
          buf,  | 
        
        
           | 
           | 
          size_t  | 
          len  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_explain_init_()
      
        
          | int _db_explain_init_  | 
          ( | 
          char *  | 
          buf,  | 
        
        
           | 
           | 
          size_t  | 
          len  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_flush_()
◆ _db_flush_gcov_()
◆ _db_fp_()
◆ _db_is_pushed_()
      
        
          | int _db_is_pushed_  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
Returns true if session-local settings have been set. 
 
 
◆ _db_keyword_()
      
        
          | int _db_keyword_  | 
          ( | 
          struct CODE_STATE *  | 
          cs,  | 
        
        
           | 
           | 
          const char *  | 
          keyword,  | 
        
        
           | 
           | 
          int  | 
          strict  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_lock_file_()
      
        
          | void _db_lock_file_  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
 
◆ _db_pargs_()
      
        
          | void _db_pargs_  | 
          ( | 
          unsigned int  | 
          _line_,  | 
        
        
           | 
           | 
          const char *  | 
          keyword  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_pop_()
◆ _db_process_()
      
        
          | void _db_process_  | 
          ( | 
          const char *  | 
          name | ) | 
           | 
        
      
 
 
◆ _db_push_()
      
        
          | void _db_push_  | 
          ( | 
          const char *  | 
          control | ) | 
           | 
        
      
 
 
◆ _db_return_()
      
        
          | void _db_return_  | 
          ( | 
          unsigned int  | 
          _line_,  | 
        
        
           | 
           | 
          struct _db_stack_frame_ *  | 
          _stack_frame_  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ _db_set_()
      
        
          | void _db_set_  | 
          ( | 
          const char *  | 
          control | ) | 
           | 
        
      
 
 
◆ _db_set_init_()
      
        
          | void _db_set_init_  | 
          ( | 
          const char *  | 
          control | ) | 
           | 
        
      
 
 
◆ _db_suicide_()
◆ _db_unlock_file_()
      
        
          | void _db_unlock_file_  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
 
◆ dbug()
template<class DBGCLOS > 
  
  
      
        
          | void dbug  | 
          ( | 
          const char *  | 
          keyword,  | 
         
        
           | 
           | 
          DBGCLOS &&  | 
          clos  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inline   | 
  
 
A type-safe interface to DBUG_EXECUTE_IF, where the debug action to activate when the keyword is provided is given as a callable object (typically a lambda). 
- Note
 - The body of the callable will be checked by the compiler even in optimized mode.
 
- Parameters
 - 
  
    | keyword | String literal which will enable this debug action.  | 
    | clos | Callable object taking no arguments which will be called in debug mode if the keyword is enabled.  | 
  
   
 
 
◆ my_abort()
Calls our own implementation of abort, if specified, or std's abort(). 
 
 
◆ set_my_abort()
      
        
          | void set_my_abort  | 
          ( | 
          void(*)()  | 
          new_my_abort_func | ) | 
           | 
        
      
 
Sets a new function to be called on my_abort(). 
- Parameters
 - 
  
    | new_my_abort_func | pointer to a new my_abort function. It can't be [[noreturn]] as pointers to methods can't have attributes.  |