shithub: scc

Download patch

ref: 3e8757f4125a99765fdd625b6a31d2236a93c4cf
parent: 8c20e677d7728c5120feb182e4d4195a7571fa71
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Sun Oct 6 10:16:59 EDT 2019

[scc] Add debug info about commands executed

--- a/src/cmd/cc/posix/scc.c
+++ b/src/cmd/cc/posix/scc.c
@@ -282,6 +282,7 @@
 static void
 spawn(int tool)
 {
+	char **ap;
 	struct tool *t = &tools[tool];
 
 	switch (t->pid = fork()) {
@@ -294,6 +295,11 @@
 			dup2(t->in, 0);
 		if (!dflag && tool != CC1 && tool != LD)
 			dup2(devnullfd, 2);
+		if (dflag) {
+			for (ap = t->args.s; *ap; ap++)
+				fprintf(stderr, " %s", *ap);
+			putc('\n', stderr);
+		}
 		execvp(t->cmd, t->args.s);
 		if (dflag) {
 			fprintf(stderr,