toolchain: instrument external toolchain wrapper
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 18 Jul 2013 21:54:50 +0000 (23:54 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Fri, 19 Jul 2013 06:32:39 +0000 (08:32 +0200)
If BR_DEBUG_WRAPPER is set in the envirnment, dump the actual command
being exec()uted, to ease debugging issues with the wrapper.

[Peter: adjust code style and output format to be cut'n'paste compatible]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
toolchain/toolchain-external/ext-toolchain-wrapper.c

index 460f255ee530e00dfc5b04391e1ede57ffbbc21d..befd735f111bd020c209ae7613210efcb1b54e2d 100644 (file)
@@ -136,6 +136,15 @@ int main(int argc, char **argv)
        /* finish with NULL termination */
        *cur = NULL;
 
+       if (getenv("BR_DEBUG_WRAPPER")) {
+               fprintf(stderr, "Executing");
+
+               for (i = 0; args[i]; i++)
+                       fprintf(stderr, " %s", args[i]);
+
+               fprintf(stderr, "\n");
+       }
+
        if (execv(path, args))
                perror(path);