toolchain/wrapper: also dump args it was called with
PATCH 1/1 toolchain/wrapper: also dump args it was called with
Signed-off-by Yann E. MORIN <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Thomas De Schampheleire <[email protected]>
--- toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-)
toolchain/toolchain-wrapper.c +29 -20
@@ -240,7 +240,24 @@ int main(int argc, char **argv)char *env_debug;char *paranoid_wrapper;int paranoid; -int ret, i, count =0 , debug, found_shared =0 ; +int ret, i, count =0 , debug =0 , found_shared =0 ; + +/* Debug the wrapper to see arguments it was called with. +* If environment variable BR2_DEBUG_WRAPPER is: +* unset, empty, or 0: do not trace +* set to 1 : trace all arguments on a single line +* set to 2 : trace one argument per line +*/ +if ((env_debug =getenv ("BR2_DEBUG_WRAPPER" ))) { + debug =atoi (env_debug); + } +if (debug >0 ) { +fprintf (stderr,"Toolchain wrapper was called with:" ); +for (i =0 ; i < argc; i++) +fprintf (stderr,"%s'%s'" , + (debug ==2 ) ?"\n " :" " , argv[i]); +fprintf (stderr,"\n" ); + }/* Calculate the relative paths */ basename =strrchr (progpath,'/' );
@@ -483,29 +500,21 @@ int main(int argc, char **argv) exec_args++;#endif -/* Debug the wrapper to see actual arguments passed to -* the compiler: -* unset, empty, or 0: do not trace -* set to 1 : trace all arguments on a single line -* set to 2 : trace one argument per line -*/ -if ((env_debug =getenv ("BR2_DEBUG_WRAPPER" ))) { - debug =atoi (env_debug); -if (debug >0 ) { -fprintf (stderr,"Toolchain wrapper executing:" ); +/* Debug the wrapper to see final arguments passed to the real compiler. */ +if (debug >0 ) { +fprintf (stderr,"Toolchain wrapper executing:" );#ifdef BR_CCACHE_HASH -fprintf (stderr,"%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'" , - (debug ==2 ) ?"\n " :" " ); +fprintf (stderr,"%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'" , + (debug ==2 ) ?"\n " :" " );#endif #ifdef BR_CCACHE_BASEDIR -fprintf (stderr,"%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'" , - (debug ==2 ) ?"\n " :" " ); +fprintf (stderr,"%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'" , + (debug ==2 ) ?"\n " :" " );#endif -for (i =0 ; exec_args[i]; i++) -fprintf (stderr,"%s'%s'" , - (debug ==2 ) ?"\n " :" " , exec_args[i]); -fprintf (stderr,"\n" ); - } +for (i =0 ; exec_args[i]; i++) +fprintf (stderr,"%s'%s'" , + (debug ==2 ) ?"\n " :" " , exec_args[i]); +fprintf (stderr,"\n" ); }#ifdef BR_CCACHE_HASH
Signature · 1 line
2.20.1
PATCH 1/1 toolchain/wrapper: also dump args it was called with
El s?b., 17 ago. 2019 a las 14:48, Yann E. MORIN
(<[email protected]>) escribi?:
Quoted 69 lines
Signed-off-by Yann E. MORIN <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Thomas De Schampheleire <[email protected]>--- toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-)toolchain/toolchain-wrapper.c +25
-17@@ -240,7 +240,24 @@ int main(int argc, char **argv)char *env_debug;char *paranoid_wrapper;int paranoid; -int ret, i, count =0 , debug, found_shared =0 ; +int ret, i, count =0 , debug =0 , found_shared =0 ; + +/* Debug the wrapper to see arguments it was called with. +* If environment variable BR2_DEBUG_WRAPPER is: +* unset, empty, or 0: do not trace +* set to 1 : trace all arguments on a single line +* set to 2 : trace one argument per line +*/ +if ((env_debug =getenv ("BR2_DEBUG_WRAPPER" ))) { + debug =atoi (env_debug); + } +if (debug >0 ) { +fprintf (stderr,"Toolchain wrapper was called with:" ); +for (i =0 ; i < argc; i++) +fprintf (stderr,"%s'%s'" , + (debug ==2 ) ?"\n " :" " , argv[i]); +fprintf (stderr,"\n" ); + }/* Calculate the relative paths */ basename =strrchr (progpath,'/' );@@ -483,29 +500,21 @@ int main(int argc, char **argv) exec_args++;#endif -/* Debug the wrapper to see actual arguments passed to -* the compiler: -* unset, empty, or 0: do not trace -* set to 1 : trace all arguments on a single line -* set to 2 : trace one argument per line -*/ -if ((env_debug =getenv ("BR2_DEBUG_WRAPPER" ))) { - debug =atoi (env_debug); -if (debug >0 ) { -fprintf (stderr,"Toolchain wrapper executing:" ); +/* Debug the wrapper to see final arguments passed to the real compiler. */ +if (debug >0 ) { +fprintf (stderr,"Toolchain wrapper executing:" );#ifdef BR_CCACHE_HASH -fprintf (stderr,"%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'" , - (debug ==2 ) ?"\n " :" " ); +fprintf (stderr,"%sCCACHE_COMPILERCHECK='string:" BR_CCACHE_HASH "'" , + (debug ==2 ) ?"\n " :" " );#endif #ifdef BR_CCACHE_BASEDIR -fprintf (stderr,"%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'" , - (debug ==2 ) ?"\n " :" " ); +fprintf (stderr,"%sCCACHE_BASEDIR='" BR_CCACHE_BASEDIR "'" , + (debug ==2 ) ?"\n " :" " );#endif -for (i =0 ; exec_args[i]; i++) - fprintf(stderr, "%s'%s'",
toolchain/toolchain-wrapper.c int main(int argc, char **argv) · line 520
Quoted 10 lines
toolchain/toolchain-wrapper.c +4
-3- (debug == 2) ? "\n " : " ", exec_args[i]); -fprintf (stderr,"\n" ); - } +for (i =0 ; exec_args[i]; i++) +fprintf (stderr,"%s'%s'" , + (debug ==2 ) ?"\n " :" " , exec_args[i]); +fprintf (stderr,"\n" ); }#ifdef BR_CCACHE_HASH
Reviewed-by Thomas De Schampheleire <[email protected]>
Thomas Petazzoni
AppliedPATCH 1/1 toolchain/wrapper: also dump args it was called with
In reply to Yann E. MORINQuoted 6 lines · On Sat, 17 Aug 2019 14:48:17 +0200 "Yann E. MORIN" <[email protected]>…
Signed-off-by Yann E. MORIN <[email protected]>Cc Thomas Petazzoni <[email protected]>Cc Thomas De Schampheleire <[email protected]>--- toolchain/toolchain-wrapper.c | 49 +++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 20 deletions(-)
Applied to next, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com