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: remove redundant lines from stack traces



details:   https://anonhg.NetBSD.org/src/rev/6909c4c94f3e
branches:  trunk
changeset: 359548:6909c4c94f3e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 09 11:43:58 2022 +0000

description:
make: remove redundant lines from stack traces

These lines repeated the information from the .for loop line above them.

diffstat:

 usr.bin/make/parse.c                        |  15 ++++++---------
 usr.bin/make/unit-tests/include-main.exp    |   1 -
 usr.bin/make/unit-tests/opt-debug-parse.exp |   3 ---
 3 files changed, 6 insertions(+), 13 deletions(-)

diffs (70 lines):

diff -r 625066fa6661 -r 6909c4c94f3e usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sun Jan 09 11:28:04 2022 +0000
+++ b/usr.bin/make/parse.c      Sun Jan 09 11:43:58 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.645 2022/01/09 11:28:04 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.646 2022/01/09 11:43:58 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -106,7 +106,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.645 2022/01/09 11:28:04 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.646 2022/01/09 11:43:58 rillig Exp $");
 
 /*
  * A file being read.
@@ -357,13 +357,10 @@
                        debug_printf("\tin .for loop from %s:%d with %s\n",
                            fname, entry->forHeadLineno, details);
                        free(details);
-               } else {
-                       int lineno =
-                           i + 1 < n && entries[i + 1].forLoop != NULL
-                               ? entries[i + 1].forHeadLineno
-                               : entry->lineno;
-                       debug_printf("\tin %s:%d\n", fname, lineno);
-               }
+               } else if (i + 1 < n && entries[i + 1].forLoop != NULL) {
+                       /* entry->lineno is not a useful line number */
+               } else
+                       debug_printf("\tin %s:%d\n", fname, entry->lineno);
        }
 }
 
diff -r 625066fa6661 -r 6909c4c94f3e usr.bin/make/unit-tests/include-main.exp
--- a/usr.bin/make/unit-tests/include-main.exp  Sun Jan 09 11:28:04 2022 +0000
+++ b/usr.bin/make/unit-tests/include-main.exp  Sun Jan 09 11:43:58 2022 +0000
@@ -7,7 +7,6 @@
        in .for loop from include-sub.mk:31 with i = include
        in .for loop from include-sub.mk:30 with i = nested
        in .for loop from include-sub.mk:29 with i = deeply
-       in include-sub.mk:29
        in include-main.mk:27
 Parsing line 6: .MAKEFLAGS: -d0
 ParseDependency(.MAKEFLAGS: -d0)
diff -r 625066fa6661 -r 6909c4c94f3e usr.bin/make/unit-tests/opt-debug-parse.exp
--- a/usr.bin/make/unit-tests/opt-debug-parse.exp       Sun Jan 09 11:28:04 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-parse.exp       Sun Jan 09 11:43:58 2022 +0000
@@ -3,7 +3,6 @@
 Parsing line 20: .info trace with multi-line .for loop head
 make: "opt-debug-parse.mk" line 20: trace with multi-line .for loop head
        in .for loop from opt-debug-parse.mk:16 with var = value
-       in opt-debug-parse.mk:16
 ParseEOF: returning to file opt-debug-parse.mk, line 22
 SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
 Parsing line 25: .include "/dev/null"
@@ -17,11 +16,9 @@
 Parsing line 31: .info trace
 make: "opt-debug-parse.mk" line 31: trace
        in .for loop from opt-debug-parse.mk:30 with a = 1, b = 2, c = 3
-       in opt-debug-parse.mk:30
 Parsing line 31: .info trace
 make: "opt-debug-parse.mk" line 31: trace
        in .for loop from opt-debug-parse.mk:30 with a = 4, b = 5, c = 6
-       in opt-debug-parse.mk:30
 ParseEOF: returning to file opt-debug-parse.mk, line 33
 SetFilenameVars: ${.PARSEDIR} = `<curdir>' ${.PARSEFILE} = `opt-debug-parse.mk'
 Parsing line 35: .MAKEFLAGS: -d0



Home | Main Index | Thread Index | Old Index