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)



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.


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