aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-05-30 12:32:31 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-05-30 12:32:31 +0300
commita14a6881538229cd938282bd56c7f0d12a089be6 (patch)
tree89cfa47078460e7505c1a80ce71488eef29dfc63 /tests
parent07caec236e3af48973874f2c0e19bafec4d13f78 (diff)
downloadgdbm-a14a6881538229cd938282bd56c7f0d12a089be6.tar.gz
gdbm-a14a6881538229cd938282bd56c7f0d12a089be6.tar.bz2
Drop debugging hooks
The hooks were introduced as a temporary tool in de7834e9. They did their job and are not necessary any more.
Diffstat (limited to 'tests')
-rw-r--r--tests/gtload.c68
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/gtload.c b/tests/gtload.c
index 273ebbe..21c89b2 100644
--- a/tests/gtload.c
+++ b/tests/gtload.c
@@ -41,32 +41,2 @@ err_printer (void *data, char const *fmt, ...)
-struct hook_closure
-{
- unsigned skip;
- unsigned hits;
- int disabled;
-};
-
-static int
-hookfn (char const *file, int line, char const *id, void *data)
-{
- struct hook_closure *clos = data;
-
- if (clos->disabled)
- return 0;
- if (clos->skip)
- {
- --clos->skip;
- return 0;
- }
- if (clos->hits)
- {
- if (--clos->hits == 0)
- clos->disabled = 1;
- }
-
- if (verbose)
- fprintf (stderr, "%s:%d: hit debug hook %s\n", file, line, id);
- return -1;
-}
-
size_t
@@ -96,33 +66,2 @@ read_size (char const *arg)
-void
-install_hook (char *id)
-{
- char *p = strchr (id, ';');
- struct hook_closure *clos = malloc (sizeof (*clos));
- assert (clos != NULL);
- memset (clos, 0, sizeof (*clos));
- if (p)
- {
- char *q;
-
- *p++ = 0;
- for (q = strtok (p, ";"); q; q = strtok (NULL, ";"))
- {
- if (strncmp (q, "skip=", 5) == 0)
- clos->skip = strtoul (q + 5, NULL, 10);
- else if (strncmp (q, "hits=", 5) == 0)
- clos->hits = strtoul (q + 5, NULL, 10);
- else
- {
- fprintf (stderr, "%s: unknown parameter for hook %s: %s",
- progname, id, q);
- exit (1);
- }
- }
- }
-#ifdef GDBM_DEBUG_ENABLE
- _gdbm_debug_hook_install (id, hookfn, clos);
-#endif
-}
-
#ifdef GDBM_DEBUG_ENABLE
@@ -197,9 +136,2 @@ main (int argc, char **argv)
delim = arg[7];
-#if GDBM_DEBUG_ENABLE
- else if (strncmp (arg, "-hook=", 6) == 0)
- {
- install_hook (arg + 6);
- recover = 1;
- }
-#endif
else if (strcmp (arg, "-recover") == 0)

Return to:

Send suggestions and report system problems to the System administrator.