This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Add -### option


At 5:29 PM -0600 10/29/01, Robert Lipe wrote:

>I know it's not much of a justification, but several System V vendor
>compilers support that.  From 'man cc':
>
>   -#, -i  Turn on driver debugging. Print out each command with its options
>           and arguments as invoked by cc before the command is executed.
>
>   -##, -ii
>           Print out the full pathname of each command, in addition to the
>           command, its options and arguments as invoked by cc before the
>           command is executed.
>
>   -###, -iii
>           The same as -##, except that the command is not executed.

So there is president for -### other than Sun :-)  I forgot to add 
previously that I didn't really care what the option was called 
because it was originally created to be buried down in a bash script 
I have for gcc debugging (as I alluded in the original patch 
message).  In that script I pass a normal xgcc command line, generate 
the driver command command lines using the -###, extract out the cc1* 
line, setup the stuff for gdb, and invoke gdb on the cc1*.

Originally -v was used.  But there are problems with this if what I 
was trying to debug took forever to get there (e.g., lots of 
#includes), or the cc1* blew so I would never reach gdb, or if the -v 
output required stuff to be properly quoted.  The -### solves all 
these problems.  The script invokes gdb rapidly (and I only have to 
process all the #includes during the debugging session not once for 
the -v and once for the debugging session) or if cc1* blows I'm able 
to actually debug it (which is the whole object of this sport)!  This 
is all so I don't have to manually extract the cc1* line out of a -v 
output.  And even doing that quoting is still a potential problem.

Ira


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]