scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 3e8757f4125a99765fdd625b6a31d2236a93c4cf
parent 8c20e677d7728c5120feb182e4d4195a7571fa71
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun,  6 Oct 2019 14:16:59 +0200

[scc] Add debug info about commands executed

Diffstat:
Msrc/cmd/cc/posix/scc.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/cmd/cc/posix/scc.c b/src/cmd/cc/posix/scc.c @@ -282,6 +282,7 @@ settool(int tool, char *infile, int nexttool) static void spawn(int tool) { + char **ap; struct tool *t = &tools[tool]; switch (t->pid = fork()) { @@ -294,6 +295,11 @@ spawn(int tool) 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,