Module Name: src
Committed By: christos
Date: Wed Jul 17 15:42:03 UTC 2013
Modified Files:
src/sbin/ifconfig: parse.c
Log Message:
print the next parser name instead of just the pointer in debugging.
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sbin/ifconfig/parse.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/ifconfig/parse.c
diff -u src/sbin/ifconfig/parse.c:1.17 src/sbin/ifconfig/parse.c:1.18
--- src/sbin/ifconfig/parse.c:1.17 Fri Mar 1 13:25:16 2013
+++ src/sbin/ifconfig/parse.c Wed Jul 17 11:42:03 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.17 2013/03/01 18:25:16 joerg Exp $ */
+/* $NetBSD: parse.c,v 1.18 2013/07/17 15:42:03 christos Exp $ */
/*-
* Copyright (c) 2008 David Young. All rights reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: parse.c,v 1.17 2013/03/01 18:25:16 joerg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.18 2013/07/17 15:42:03 christos Exp $");
#endif /* not lint */
#include <err.h>
@@ -49,7 +49,11 @@ __RCSID("$NetBSD: parse.c,v 1.17 2013/03
#include "parse.h"
#include "util.h"
+#ifdef DEBUG
+#define dbg_warnx(__fmt, ...) warnx(__fmt, __VA_ARGS__)
+#else
#define dbg_warnx(__fmt, ...) /* empty */
+#endif
static int parser_default_init(struct parser *);
static int pbranch_init(struct parser *);
@@ -568,9 +572,9 @@ pbranch_match(const struct parser *p, co
memset(&tmpm, 0, sizeof(tmpm));
SIMPLEQ_FOREACH(b, &pb->pb_branches, b_next) {
- dbg_warnx("%s: b->b_nextparser %p", __func__,
- (const void *)b->b_nextparser);
nextp = b->b_nextparser;
+ dbg_warnx("%s: b->b_nextparser %p [%s]", __func__,
+ nextp, nextp ? nextp->p_name : "(null)");
if (nextp == NULL) {
if (arg == NULL) {
nmatch++;
@@ -766,8 +770,9 @@ pbranch_setbranches(struct pbranch *pb,
if ((b = malloc(sizeof(*b))) == NULL)
goto err;
*b = brs[i];
- dbg_warnx("%s: b->b_nextparser %p", __func__,
- (const void *)b->b_nextparser);
+ dbg_warnx("%s: b->b_nextparser %p [%s]", __func__,
+ b->b_nextparser, b->b_nextparser ? b->b_nextparser->p_name
+ : "(null)");
SIMPLEQ_INSERT_TAIL(&pb->pb_branches, b, b_next);
}