mysql_debug

You are viewing an old version of this article. View the current version here.

構文

void mysql_debug(const char * debug);
  • debug - デバッグ対象の文字列。詳細は下記。

Description

Fred Fishのデバッグライブラリを利用することで、開発のためのデバッグを可能にします。 この機能を利用するためには、mariadbのクライアントライブラリがデバッグ有効の状態でコンパイルされている必要があります。

戻り値はありません。

デバッグされる文字列は、以下のようにコロンで分割されたフィールド順で出力されます。

フィールド1:フィールド2:フィールドn

それぞれのフィールドはフラグ文字を含みます。オプションでカンマおよびカンマ区切りのmodifierを出力できます。

フラグ[,modifier,modifier,...,modifier]

現在認識されるフラグ文字は下記です。

OptionDescription
dEnable output from DBUG_ macros for for the current state. May be followed by a list of keywords which selects output only for the DBUG macros with that keyword. A null list of keywords implies output for all macros.
DDelay after each debugger output line. The argument is the number of tenths of seconds to delay, subject to machine capabilities. I.E. -#D,20 is delay two seconds.
fLimit debugging and/or tracing, and profiling to the list of named functions. Note that a null list will disable all functions. The appropriate "d" or "t" flags must still be given, this flag only limits their actions if they are enabled.
FIdentify the source file name for each line of debug or trace output.
iIdentify the process with the pid for each line of debug or trace output.
gEnable profiling. Create a file called 'dbugmon.out' containing information that can be used to profile the program. May be followed by a list of keywords that select profiling only for the functions in that list. A null list implies that all functions are considered.
LIdentify the source file line number for each line of debug or trace output.
nPrint the current function nesting depth for each line of debug or trace output.
NNumber each line of dbug output.
oRedirect the debugger output stream to the specified file. The default output is stderr.
OAs O but the file is really flushed between each write. When needed the file is closed and reopened between each write.
pLimit debugger actions to specified processes. A process must be identified with the DBUG_PROCESS macro and match one in the list for debugger actions to occur.
PPrint the current process name for each line of debug or trace output.
rWhen pushing a new state, do not inherit the previous state's function nesting level. Useful when the output is to start at the left margin.
SDo function _sanity(_file_,_line_) at each debugged function until _sanity() returns something that differs from 0. (Mostly used with safemalloc)
tEnable function call/exit trace lines. May be followed by a list (containing only one modifier) giving a numeric maximum trace level, beyond which no output will occur for either debugging or tracing macros. The default is a compile time option.

Instead of using the mysql_debug() function you also can set the environment variable MYSQL_DEBUG

Enabling generation of debug information slows down the overall performance and generates huge files. In case you need debug information only for special places you can disable the generation of debug information by using mysql_debug_end().

合わせて読む

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.