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/fa6eca80fc95
branches:  trunk
changeset: 937685:fa6eca80fc95
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 9801c538791e -r fa6eca80fc95 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