This is the mail archive of the 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)

Right..  No comments at all on this one.

So - there are three ways to pass arguments to the inferior process:

1) as an escaped string: My favorite, but no-one else seems to like it.
Pro: can be treated as just another option by the wrapper functions
(gdb, xxgdb, etc.)

Cons: can make arguments with quotes, etc., much more difficult to
Could require parsing inside GDB to allow for escape sequences; e.g.,
if we are attempting to debug grep.

2) gdb [<various options>] -run <progname> <inf_arg1> .. <inf_argn>
Pro: Simple for the user to invoke GDB from the commandline - just
go back to the beginning of the line, and type "gdb -run" in front
of the command.

Cons: changes format of gdb.  Harder for wrapper programs to adapt
to it.

3) like X: when gdb encounters -- on the command line, all the
following arguments are treated as arguments to the inferior process.

Pro: simple to use.  Doesn't change syntax as much as 2.  Precedent
for it already exists.  

Con: breaks anything that uses core files that are named "--",
although that's probably not too likely.

4) like 3), but with a --args-enable option that turns it on -
this preserves perfect compatability with all the existing

At this point, 99.5% of the work is done towards any of these options.
My personal preference is towards 1) or 4).

Which way do I need to go to get a patch in?


The thing between Death's triumphant digits was a fly from the dawn of
time. It was the fly in the primordial soup. It had bred on mammoth
turds.  It wasn't a fly that bangs on window panes, it was a fly that
drills through walls.
        -- Death goes fishing
           (Terry Pratchett, Mort)

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