Module Name: src Committed By: kre Date: Sat Jun 17 12:16:16 UTC 2017
Modified Files: src/bin/sh: show.c Log Message: NFC - DEBUG mode only change - complete a change made earlier (marking the line number when included in the trace line tag to show whether it comes from the parser, or the elsewhere as they tend to be quite different). Initially only one case was changed, while I pondered whether I liked it or not. Now it is all done... Also when there is a line tag at all, always include the root/sub-shell indicator character, not only when the pid is included. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/bin/sh/show.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/sh/show.c diff -u src/bin/sh/show.c:1.45 src/bin/sh/show.c:1.46 --- src/bin/sh/show.c:1.45 Sat Jun 17 04:16:33 2017 +++ src/bin/sh/show.c Sat Jun 17 12:16:16 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: show.c,v 1.45 2017/06/17 04:16:33 kre Exp $ */ +/* $NetBSD: show.c,v 1.46 2017/06/17 12:16:16 kre Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)show.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: show.c,v 1.45 2017/06/17 04:16:33 kre Exp $"); +__RCSID("$NetBSD: show.c,v 1.46 2017/06/17 12:16:16 kre Exp $"); #endif #endif /* not lint */ @@ -933,6 +933,7 @@ trace_id(TFILE *tf) char indent[16]; char *p; int lno; + char c; if (DFlags & DBG_NEST) { if ((unsigned)ShNest >= sizeof indent - 1) { @@ -961,23 +962,24 @@ trace_id(TFILE *tf) else lno = line_number; + c = ((i = getpid()) == tf->pid) ? ':' : '='; + if (DFlags & DBG_PID) { - i = getpid(); if (DFlags & DBG_LINE) - (void) asprintf(&p, "%5d%c%s\t%4d%c@\t", i, - i == tf->pid ? ':' : '=', indent, lno, parsing?'-':'+'); + (void) asprintf(&p, "%5d%c%s\t%4d%c@\t", i, c, + indent, lno, parsing?'-':'+'); else - (void) asprintf(&p, "%5d%c%s\t", i, - i == tf->pid ? ':' : '=', indent); + (void) asprintf(&p, "%5d%c%s\t", i, c, indent); return p; } else if (DFlags & DBG_NEST) { if (DFlags & DBG_LINE) - (void) asprintf(&p, "%s\t%4d @\t", indent, lno); + (void) asprintf(&p, "%c%s\t%4d%c@\t", c, indent, lno, + parsing?'-':'+'); else - (void) asprintf(&p, "%s\t", indent); + (void) asprintf(&p, "%c%s\t", c, indent); return p; } else if (DFlags & DBG_LINE) { - (void) asprintf(&p, "%4d @\t", lno); + (void) asprintf(&p, "%c%4d%c@\t", c, lno, parsing?'-':'+'); return p; } return NULL;