From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eli Zaretskii" To: tromey@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: Inferior command line arguments Date: Fri, 28 Sep 2001 07:21:00 -0000 Message-id: <4331-Fri28Sep2001162207+0300-eliz@is.elta.co.il> References: <87zo7gq7gb.fsf@creche.redhat.com> <2593-Fri28Sep2001103201+0300-eliz@is.elta.co.il> <87u1xnh4ns.fsf@creche.redhat.com> X-SW-Source: 2001-09/msg00415.html > From: Tom Tromey > Date: 28 Sep 2001 06:37:59 -0600 > > >> +/* Given a vector of command-line arguments, return a newly allocated > >> + string which, when passed to the create_inferior function, will be > >> + parsed to yield the same vector. > > Eli> I'm probably missing something important here, but this comment begs a > Eli> question: if all we need is to get the same vector in the end, why go > Eli> through the pain of quoting it and then unquoting it again? Can't we > Eli> just sneak the original vector in somehow? > > On Unix platforms, aside from some unusual situations, gdb uses the > user's shell to invoke the inferior. The shell, not gdb, is doing the > unquoting. Oh, so in the comment above that confused me you meant ``...will be parsed _by_the_shell_ to yield the same vector'', yes? > On other platforms gdb might do some unquoting. I looked at a few > (but not all), though, and generally speaking this doesn't seem to > happen. The Windows port passes the argument string to CreateProcess > (I don't know how Windows unquoting is done, but presumably gdb can't > affect it). AFAIK, CreateProcess acts like a stock Windows shell wrt the command line handling. The DJGPP port emulates the shell, so it also acts like a shell. But the quoting rules are a bit different in those two cases.