From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Tromey To: Alexandre Oliva 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:27:00 -0000 Message-id: <87k84yir1z.fsf@creche.redhat.com> References: <20010330005457.A21793@llamedos.org> <20010330163603.A27435@llamedos.org> <20010403013600.B7630@llamedos.org> X-SW-Source: 2001-04/msg00049.html >>>>> "Alexandre" == Alexandre Oliva writes: Alexandre> Speaking as someone who isn't officially involved in the Alexandre> decision-making of GDB, I'm leaning towards 3. --run (that Alexandre> I had suggested originally) may imply gdb will actually Alexandre> start the program, instead of just setting up the argument Alexandre> list. `--' is better in this sense. I don't see much need Alexandre> of --args-enable; one can always use /-- instead of -- if Alexandre> their core file is named --. I agree `--run' isn't best name. However the problem with `gdb foo -- arg1 arg2 arg3' is that it inserts the `--' between the command and the arguments. This complicates inserting the `gdb' invocation into shell scripts. Code like this (which does occur from time to time): "$@" becomes: foo="$1" shift gdb "$foo" -- ${1+"$@"} (which also introduces script-visible side effects...) rather than simply: gdb --run "$@" Maybe I'm missing an easier way to do it. My desire for this feature is that it be trivial to drop in place. That will maximize its usefulness. One option would be: gdb -- prog arg1 arg2 arg3 That is a change from existing gdb use though. Plus then you have to decide what to do when somebody inevitably tries: gdb prog -- somethingelse arg1 arg2 arg3 (An error wouldn't be unreasonable though.) Tom