From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexandre Oliva To: tromey@redhat.com Cc: deephan@erols.com, gdb-patches@sources.redhat.com Subject: Re: [PATCH] specify arguments to debugee from commandline (second try) Date: Thu, 05 Apr 2001 21:47:00 -0000 Message-id: References: <20010330005457.A21793@llamedos.org> <20010330163603.A27435@llamedos.org> <20010403013600.B7630@llamedos.org> <87k84yir1z.fsf@creche.redhat.com> X-SW-Source: 2001-04/msg00050.html On Apr 6, 2001, Tom Tromey wrote: > However the problem with `gdb foo -- arg1 arg2 arg3' is that it > inserts the `--' between the command and the arguments. In the case of a wrapper script, which would probably be the most common use of this feature, the command will be in $0, and the argument list in $@. So, to debug cc1, you'd probably do: mv cc1 cc1.bin echo 'exec ${DEBUGGER-gdb} "$0".bin -- ${1+"$@"}' > cc1 chmod +x cc1 -- Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} Free Software Evangelist *Please* write to mailing lists, not to me