RFC: [patch] launching compiler through a wrapper

Alexandre Oliva aoliva@redhat.com
Fri Mar 6 18:29:00 GMT 2009


Hi, Thomas,

On Mar  6, 2009, Thomas Quinot <quinot@adacore.com> wrote:

> I would like to propose a new feature of the gcc driver to allow
> launching the underlying compiler in a debugger session. This is useful
> when debugging the compiler, since this guarantees that the debugging
> session is started in the exact same context (environment, temporary
> files...) as for a "normal" invocation of the compiler (whereas if you
> start the debugging session manually, you have to have other means to
> reconstitute these conditions, which may be impractical).

> Included below is a first implementation of this idea, where the wrapper
> command is specified using environment variable GCC_WRAP_COMPILER.
> A typical simple usage is to set GCC_WRAP_COMPILER="gdb --args".

I like this idea.  In the mean time, you might want to use the 'debugx'
script.  Here's how I use it:

debugx cc1 ./xgcc -B./ ...

It needs the companion script 'debug' in the PATH to actually launch the
debugger, from a wrapper created by debugx.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: debugx
Type: application/x-sh
Size: 903 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090306/df495a1d/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug
Type: application/x-sh
Size: 1874 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090306/df495a1d/attachment-0001.sh>
-------------- next part --------------


Maybe this should be added to contrib/

-- 
Alexandre Oliva           http://www.lsd.ic.unicamp.br/~oliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer


More information about the Gcc-patches mailing list