Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh NFC: DEBUG mode change - add a couple more TRACE macr...



details:   https://anonhg.NetBSD.org/src/rev/6b95ff219013
branches:  trunk
changeset: 825632:6b95ff219013
user:      kre <kre%NetBSD.org@localhost>
date:      Wed Jul 26 03:44:43 2017 +0000

description:
NFC: DEBUG mode change - add a couple more TRACE macros to allow for
conditional (apart from the normal debug conditions) tracing.

diffstat:

 bin/sh/shell.h |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diffs (46 lines):

diff -r e42752fd0b92 -r 6b95ff219013 bin/sh/shell.h
--- a/bin/sh/shell.h    Wed Jul 26 03:40:39 2017 +0000
+++ b/bin/sh/shell.h    Wed Jul 26 03:44:43 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: shell.h,v 1.24 2017/06/17 12:41:20 kre Exp $   */
+/*     $NetBSD: shell.h,v 1.25 2017/07/26 03:44:43 kre Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -123,6 +123,11 @@
                                        trace param;                    \
                                } while (/*CONSTCOND*/ 0)
 
+#define CCTRACE(when,cond,param) do {                                  \
+                                   if ((cond) && (DFlags & (when)) != 0) \
+                                       trace param;                    \
+                               } while (/*CONSTCOND*/ 0)
+
 #define CTRACEV(when, param)   do {                                    \
                                    if ((DFlags & (when)) != 0)         \
                                        tracev param;                   \
@@ -141,6 +146,12 @@
                                            trace param;                \
                                } while (/*CONSTCOND*/ 0)
 
+#define CVTRACE(when,cond,param) do {                                  \
+                                   if ((cond) && (DFlags &             \
+                                       (when)<<DBG_VBOSE_SHIFT) != 0)  \
+                                           trace param;                \
+                               } while (/*CONSTCOND*/ 0)
+
 #define VTRACEV(when, param)   do {                                    \
                                    if ((DFlags &                       \
                                        (when)<<DBG_VBOSE_SHIFT) != 0)  \
@@ -204,9 +215,11 @@
 #define TRACEV(param)                  /* historic varargs trace */
 
 #define CTRACE(when, param)            /* conditional normal trace */
+#define CCTRACE(when, cond, param)     /* more conditional normal trace */
 #define CTRACEV(when, param)           /* conditional varargs trace */
 #define XTRACE(when, param, extra)     /* conditional trace, plus more */
 #define VTRACE(when, param)            /* conditional verbose trace */
+#define CVTRACE(when, cond, param)     /* more conditional verbose trace */
 #define VTRACEV(when, param)           /* conditional verbose varargs trace */
 #define VXTRACE(when, param, extra)    /* cond verbose trace, plus more */
 



Home | Main Index | Thread Index | Old Index