From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Deephanphongs To: gdb-patches@sources.redhat.com Subject: Re: RFC: Inferior command line arguments Date: Sat, 29 Sep 2001 01:23:00 -0000 Message-id: <20010929042717.B8313@llamedos.org> References: <87zo7gq7gb.fsf@creche.redhat.com> <3BB4C04D.22C3DAB5@cygnus.com> <877kuji2b7.fsf@creche.redhat.com> <20010928145938.A13638@nevyn.them.org> <3BB4CF12.3020900@cygnus.com> <20010928154217.A17406@nevyn.them.org> <87vgi3f1f1.fsf@creche.redhat.com> X-SW-Source: 2001-09/msg00448.html Thus spake Tom Tromey (tromey@redhat.com): > > I'm not really a fan of `---'. It doesn't seem visible enough. > > I might be able to make `--args' end argument processing. Then you > would write: > > gdb --args gdb -nw > Have you seen my patch? getopt only reorders the arguments that it has already processed. So, if you detect --args, and break out of the argument-processing loop, argv[optind] is equal to the target name, and argv[optind+1] ... argv[argc-1] are the target's arguments. How are you handling the fact that you don't know what the target is until far later in the code? Dave -- "The knuckles! The horrible knuckles!" -- (Terry Pratchett, The Light Fantastic)