List:Maria Storage Engine« Previous MessageNext Message »
From:Sergei Golubchik Date:February 11 2009 6:57pm
Subject:bzr commit into MySQL/Maria:mysql-maria branch (serg:2731)
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-maria/ based on revid:serg@stripped

 2731 Sergei Golubchik	2009-02-11
      support for glob(7) patterns in dbug
modified:
  configure.in
  dbug/dbug.c
  dbug/user.r

=== modified file 'configure.in'
--- a/configure.in	2008-12-10 09:02:25 +0000
+++ b/configure.in	2009-02-11 18:57:38 +0000
@@ -814,7 +814,7 @@ AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
- memory.h pwd.h select.h \
+ memory.h pwd.h select.h fnmatch.h \
  stdlib.h stddef.h sys/stat.h \
  strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
  sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \

=== modified file 'dbug/dbug.c'
--- a/dbug/dbug.c	2009-02-10 18:13:24 +0000
+++ b/dbug/dbug.c	2009-02-11 18:57:38 +0000
@@ -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, co
 
   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;

=== modified file 'dbug/user.r'
--- a/dbug/user.r	2008-04-28 16:24:05 +0000
+++ b/dbug/user.r	2009-02-11 18:57:38 +0000
@@ -941,6 +941,9 @@ a complete log file in case of crashes. 
 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 (val
 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 
 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, 
 .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

Thread
bzr commit into MySQL/Maria:mysql-maria branch (serg:2731) Sergei Golubchik11 Feb