Commit b4d0bf10 authored by Sergei Golubchik's avatar Sergei Golubchik

support for glob(7) patterns in dbug

parent 2637dda6
......@@ -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 \
......
......@@ -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;
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment