This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] specify arguments to debugee from commandline (second try)


>>>>> "Alexandre" == Alexandre Oliva <aoliva@redhat.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]