From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: David Deephanphongs Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] specify arguments to debugee from commandline (second try) Date: Thu, 07 Jun 2001 00:00:00 -0000 Message-id: References: <20010607024045.A25325@llamedos.org> X-SW-Source: 2001-06/msg00117.html 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.