Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): add debug logging for setting and rese...



details:   https://anonhg.NetBSD.org/src/rev/d4e262d5c909
branches:  trunk
changeset: 946296:d4e262d5c909
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Nov 22 20:29:53 2020 +0000

description:
make(1): add debug logging for setting and resetting the main target

The suffix code still doesn't behave as expected.  Make sure that at
least setting the main target works as expected.  It does, and the added
debug logging provides further hints for debugging the suffix handling
code.

diffstat:

 usr.bin/make/parse.c |  5 +++--
 usr.bin/make/suff.c  |  7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (61 lines):

diff -r 003cc1d4a4b0 -r d4e262d5c909 usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Nov 22 20:17:39 2020 +0000
+++ b/usr.bin/make/parse.c      Sun Nov 22 20:29:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.446 2020/11/22 19:14:24 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.447 2020/11/22 20:29:53 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -117,7 +117,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.446 2020/11/22 19:14:24 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.447 2020/11/22 20:29:53 rillig Exp $");
 
 /* types and constants */
 
@@ -1006,6 +1006,7 @@
     for (ln = targets->first; ln != NULL; ln = ln->next) {
        GNode *gn = ln->datum;
        if (!(gn->type & OP_NOTARGET)) {
+           DEBUG1(MAKE, "Setting main node to \"%s\"\n", gn->name);
            mainNode = gn;
            Targ_SetMain(gn);
            return;
diff -r 003cc1d4a4b0 -r d4e262d5c909 usr.bin/make/suff.c
--- a/usr.bin/make/suff.c       Sun Nov 22 20:17:39 2020 +0000
+++ b/usr.bin/make/suff.c       Sun Nov 22 20:29:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: suff.c,v 1.299 2020/11/22 18:13:52 rillig Exp $        */
+/*     $NetBSD: suff.c,v 1.300 2020/11/22 20:29:53 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*     "@(#)suff.c     8.4 (Berkeley) 3/21/94" */
-MAKE_RCSID("$NetBSD: suff.c,v 1.299 2020/11/22 18:13:52 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.300 2020/11/22 20:29:53 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -686,6 +686,7 @@
 
     if (*inout_main == NULL && *inout_removedMain &&
        !(target->type & OP_NOTARGET)) {
+       DEBUG1(MAKE, "Setting main node to \"%s\"\n", target->name);
        *inout_main = target;
        Targ_SetMain(target);
        /*
@@ -726,6 +727,8 @@
 
     if (ParseTransform(target->name, &srcSuff, &targSuff)) {
        if (*inout_main == target) {
+           DEBUG1(MAKE, "Setting main node from \"%s\" back to null\n",
+                  target->name);
            *inout_removedMain = TRUE;
            *inout_main = NULL;
            Targ_SetMain(NULL);



Home | Main Index | Thread Index | Old Index