scc

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

commit 24a06d34fdc06083ea81cedd323ffdb53553fac2
parent 13685676aebe6f26eb4640a158d3b746939c7586
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,