diff options
author | Sergei Golubchik <serg@mysql.com> | 2009-02-11 19:57:38 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2009-02-11 19:57:38 +0100 |
commit | b4d0bf108461386dc42b0fff7222fc68592d046d (patch) | |
tree | e41936d718a258636de07e50c42606f677fad6bd /dbug | |
parent | 2637dda66845868fe996e60e54996acf03f6c537 (diff) | |
download | mariadb-git-b4d0bf108461386dc42b0fff7222fc68592d046d.tar.gz |
support for glob(7) patterns in dbug
Diffstat (limited to 'dbug')
-rw-r--r-- | dbug/dbug.c | 11 | ||||
-rw-r--r-- | dbug/user.r | 15 |
2 files changed, 23 insertions, 3 deletions
diff --git a/dbug/dbug.c b/dbug/dbug.c index 1e18fb3eab0..33971d5523a 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -75,7 +75,7 @@ * (the logic is - think of a call stack as of a path. * "function" means only this function, "function/" means the hierarchy. * in the future, filters like function1/function2 could be supported. - * wildcards are a natural extension too: * and ?) + * following this logic glob(7) wildcards are supported.) * */ @@ -88,6 +88,13 @@ #include <my_global.h> #include <m_string.h> #include <errno.h> + +#ifdef HAVE_FNMATCH_H +#include <fnmatch.h> +#else +#define fnmatch(A,B,C) strcmp(A,B) +#endif + #if defined(MSDOS) || defined(__WIN__) #include <process.h> #endif @@ -1547,7 +1554,7 @@ static int InList(struct link *linkp, const char *cp) for (result=MATCHED; linkp != NULL; linkp= linkp->next_link) { - if (!strcmp(linkp->str, cp)) + if (!fnmatch(linkp->str, cp, 0)) return linkp->flags; if (!(linkp->flags & EXCLUDE)) result=NOT_MATCHED; diff --git a/dbug/user.r b/dbug/user.r index 527ad1f43cd..25579b5488f 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -941,6 +941,9 @@ a complete log file in case of crashes. This mode is implicit in multi-threaded environment. .LI d[,keywords] Enable output from macros with specified keywords. +Every keyword can be a +.I glob(7) +pattern. An empty list of keywords implies that all keywords are selected. .LI D[,time] Delay for specified time after each output line, to let output drain. @@ -948,6 +951,9 @@ Time is given in tenths of a second (value of 10 is one second). Default is zero. .LI f[,functions] Limit debugger actions to the specified list of functions. +Every function can be a +.I glob(7) +pattern. An empty list of functions implies that all functions are selected. Every function in the list may optionally be followed by a '/' - this will implicitly select all the functions down the call stack. @@ -966,6 +972,9 @@ Mark each debugger output line with the PID (or thread ID) of the current process. .LI g,[functions] Enable profiling for the specified list of functions. +Every function can be a +.I glob(7) +pattern. An empty list of functions enables profiling for all functions. See .B PROFILING\ WITH\ DBUG @@ -984,7 +993,11 @@ Like 'a[,file]' but overwrite old file, do not append. .LI O[,file] Like 'A[,file]' but overwrite old file, do not append. .LI p[,processes] -Limit debugger actions to the specified processes. An empty list +Limit debugger actions to the specified processes. +Every name can be a +.I glob(7) +pattern. +An empty list implies all processes. This is useful for processes which run child processes. Note that each debugger output line can be marked with the name of the current process via the 'P' flag. The process name must |