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)
- To: gdb-patches at sources dot redhat dot com
- Subject: Re: [PATCH] specify arguments to debugee from commandline (second try)
- From: David Deephanphongs <deephan at erols dot com>
- Date: Tue, 3 Apr 2001 01:36:00 -0400
- References: <20010330005457.A21793@llamedos.org> <20010330163603.A27435@llamedos.org>
- Reply-To: deephan at erols dot com
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
write.
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
scripts.
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?
Dave
--
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)