This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] specify arguments to debugee from commandline (second try)
On Apr 6, 2001, Tom Tromey <tromey@redhat.com> 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