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: David Deephanphongs <deephan at telocity dot com>
- Subject: Re: [PATCH] specify arguments to debugee from commandline (second try)
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Thu, 7 Jun 2001 10:02:21 +0300 (IDT)
- cc: gdb-patches at sources dot redhat dot com
On Thu, 7 Jun 2001, David Deephanphongs wrote:
> GDB will escape the following characters within an inferior argument:
> ^|&#<>\"'`$*?[](); \{}
> ^----space
The function which implements this should be OS-dependent. What you
wrote might work for /bin/sh, but not for non-Posix systems such as
MS-Windows.
To avoid ugly OS-specific #ifdef's, perhaps we should add a hook function
pointer whcih a port could set to point to its private function. Then
the code you wrote could be the default.
> One thing I'm a little confused about - I thought that GNU getopt
> (and getopt_long_only) moved arguments to the beginning of argv,
> but that doesn't seem to be the case.
This is controlled by the first character of the third argument to
`getopt' and `getopt_long_only': if that first character is `-' or `+',
`getopt' behaves differently as to the ordering of the options. See the
comments in getopt.c about the "enum ordering" type.