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): make navigating lists in debugging mod...



details:   https://anonhg.NetBSD.org/src/rev/84a63511b967
branches:  trunk
changeset: 943005:84a63511b967
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 23 16:18:12 2020 +0000

description:
make(1): make navigating lists in debugging mode easier

Lst is an untyped list of pointers.  During debugging, it is often
necessary to inspect the content of the list.  To do this without manual
typecasting, add a few aliases for the LstNode.datum pointer, for
inspecting GNodes and strings.

diffstat:

 usr.bin/make/lst.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 7712a7a265c0 -r 84a63511b967 usr.bin/make/lst.c
--- a/usr.bin/make/lst.c        Sun Aug 23 16:03:54 2020 +0000
+++ b/usr.bin/make/lst.c        Sun Aug 23 16:18:12 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.c,v 1.38 2020/08/23 11:13:08 rillig Exp $ */
+/* $NetBSD: lst.c,v 1.39 2020/08/23 16:18:12 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -37,11 +37,11 @@
 #include "make.h"
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lst.c,v 1.38 2020/08/23 11:13:08 rillig Exp $";
+static char rcsid[] = "$NetBSD: lst.c,v 1.39 2020/08/23 16:18:12 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: lst.c,v 1.38 2020/08/23 11:13:08 rillig Exp $");
+__RCSID("$NetBSD: lst.c,v 1.39 2020/08/23 16:18:12 rillig Exp $");
 #endif /* not lint */
 #endif
 
@@ -52,7 +52,11 @@
                                 * node may not be deleted until count
                                 * goes to 0 */
     Boolean deleted;           /* List node should be removed when done */
-    void *datum;               /* datum associated with this element */
+    union {
+       void *datum;            /* datum associated with this element */
+       const GNode *gnode;     /* alias, just for debugging */
+       const char *str;        /* alias, just for debugging */
+    };
 };
 
 typedef enum {



Home | Main Index | Thread Index | Old Index