NetBSD Problem Report #15842

Received: (qmail 10011 invoked from network); 9 Mar 2002 04:16:55 -0000
Message-Id: <200203090416.g294Gqh00427@ophidian.must-have-coffee.gen.nz>
Date: Sat, 9 Mar 2002 17:16:52 +1300 (NZDT)
From: Lloyd Parkes <lloyd@must-have-coffee.gen.nz>
Reply-To: lloyd@must-have-coffee.gen.nz
To: gnats-bugs@gnats.netbsd.org
Subject: tweak to make(1) debugging output
X-Send-Pr-Version: 3.95

>Number:         15842
>Category:       bin
>Synopsis:       minor improvement to debugging of '.undef' in make(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 09 04:17:01 +0000 2002
>Closed-Date:    Sat Jun 16 19:48:26 +0000 2007
>Last-Modified:  Sat Jun 16 19:50:01 +0000 2007
>Originator:     Lloyd Parkes
>Release:        NetBSD 1.5ZA
>Organization:
Must Have Coffee
>Environment:
System: NetBSD ophidian.must-have-coffee.gen.nz 1.5ZA NetBSD 1.5ZA (GENERIC) #4: Sat Feb 23 11:24:21 NZDT 2002 lloyd@ophidian.must-have-coffee.gen.nz:/vol/NetBSD/build/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

When trying to work out what is being to a variable (e.g. 
USE_NEW_TOOLCHAIN), the make debug flags 'cv' are very handy.
Unfortunately make only tells you when it attempts to '.undef' a
variable. It doesn't always succeed and this patch logs this 

>How-To-Repeat:

Try and find out why 'make USE_NEW_TOOLCHAIN=no' doesn't work.

>Fix:

Apply the following patch.


Index: var.c
===================================================================
RCS file: /vol/NetBSD/cvs-src/basesrc/usr.bin/make/var.c,v
retrieving revision 1.68
diff -c -r1.68 var.c
*** var.c	2002/02/06 16:26:12	1.68
--- var.c	2002/03/09 04:14:49
***************
*** 402,408 ****
      Hash_Entry 	  *ln;

      if (DEBUG(VAR)) {
! 	printf("%s:delete %s\n", ctxt->name, name);
      }
      ln = Hash_FindEntry(&ctxt->context, name);
      if (ln != NULL) {
--- 402,408 ----
      Hash_Entry 	  *ln;

      if (DEBUG(VAR)) {
! 	printf("%s:delete %s ", ctxt->name, name);
      }
      ln = Hash_FindEntry(&ctxt->context, name);
      if (ln != NULL) {
***************
*** 410,419 ****

  	v = (Var *)Hash_GetValue(ln);
  	if (v->name != ln->name)
! 		free(v->name);
  	Hash_DeleteEntry(&ctxt->context, ln);
  	Buf_Destroy(v->val, TRUE);
  	free((Address) v);
      }
  }

--- 410,427 ----

  	v = (Var *)Hash_GetValue(ln);
  	if (v->name != ln->name)
! 	    free(v->name);
  	Hash_DeleteEntry(&ctxt->context, ln);
  	Buf_Destroy(v->val, TRUE);
  	free((Address) v);
+ 	if (DEBUG(VAR)) {
+ 	    printf("\n");
+ 	}
+     }
+     else {
+ 	if (DEBUG(VAR)) {
+ 	    printf(" (failed)\n", ctxt->name, name);
+ 	}
      }
  }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: dsl@netbsd.org
State-Changed-When: Sat, 16 Jun 2007 19:48:26 +0000
State-Changed-Why:
A similar fix applied to rev 1.117 of var.h


From: David Laight <dsl@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/15842 CVS commit: src/usr.bin/make
Date: Sat, 16 Jun 2007 19:47:30 +0000 (UTC)

 Module Name:	src
 Committed By:	dsl
 Date:		Sat Jun 16 19:47:29 UTC 2007

 Modified Files:
 	src/usr.bin/make: var.c

 Log Message:
 Under DEBUG(VAR) report when the variable wasn't found.
 Disposes of pr bin/15842


 To generate a diff of this commit:
 cvs rdiff -r1.116 -r1.117 src/usr.bin/make/var.c

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

>Unformatted:
 Version 1.67 of basesrc/usr.bin/make/var.c

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.