Module Name:    src
Committed By:   rillig
Date:           Sun Nov 29 14:29:20 UTC 2020

Modified Files:
        src/usr.bin/make: dir.c
        src/usr.bin/make/unit-tests: Makefile

Log Message:
make(1): add debug logging for OpenDirs_Done


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/make/dir.c
cvs rdiff -u -r1.227 -r1.228 src/usr.bin/make/unit-tests/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/dir.c
diff -u src/usr.bin/make/dir.c:1.235 src/usr.bin/make/dir.c:1.236
--- src/usr.bin/make/dir.c:1.235	Sun Nov 29 12:30:40 2020
+++ src/usr.bin/make/dir.c	Sun Nov 29 14:29:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dir.c,v 1.235 2020/11/29 12:30:40 rillig Exp $	*/
+/*	$NetBSD: dir.c,v 1.236 2020/11/29 14:29:19 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -136,7 +136,7 @@
 #include "job.h"
 
 /*	"@(#)dir.c	8.2 (Berkeley) 1/2/94"	*/
-MAKE_RCSID("$NetBSD: dir.c,v 1.235 2020/11/29 12:30:40 rillig Exp $");
+MAKE_RCSID("$NetBSD: dir.c,v 1.236 2020/11/29 14:29:19 rillig Exp $");
 
 #define DIR_DEBUG0(text) DEBUG0(DIR, text)
 #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1)
@@ -332,9 +332,13 @@ static void
 OpenDirs_Done(OpenDirs *odirs)
 {
 	CachedDirListNode *ln = odirs->list.first;
+	DIR_DEBUG1("OpenDirs_Done: %u entries to remove\n",
+	    odirs->table.numEntries);
 	while (ln != NULL) {
 		CachedDirListNode *next = ln->next;
 		CachedDir *dir = ln->datum;
+		DIR_DEBUG2("OpenDirs_Done: refCount %d for \"%s\"\n",
+		    dir->refCount, dir->name);
 		CachedDir_Destroy(dir);	/* removes the dir from odirs->list */
 		ln = next;
 	}

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.227 src/usr.bin/make/unit-tests/Makefile:1.228
--- src/usr.bin/make/unit-tests/Makefile:1.227	Sun Nov 29 10:57:16 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sun Nov 29 14:29:19 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.227 2020/11/29 10:57:16 rillig Exp $
+# $NetBSD: Makefile,v 1.228 2020/11/29 14:29:19 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -439,6 +439,7 @@ FLAGS.varname-empty=	-dv '$${:U}=cmdline
 
 # Some tests need extra postprocessing.
 SED_CMDS.dir=		${:D remove output from -DCLEANUP mode }
+SED_CMDS.dir+=		-e '/^OpenDirs_Done:/d'
 SED_CMDS.dir+=		-e '/^CachedDir refCount/d'
 SED_CMDS.export=	-e '/^[^=_A-Za-z0-9]*=/d'
 SED_CMDS.export-all=	${SED_CMDS.export}

Reply via email to