Re: PR13901

Pedro Alves
2012-04-02T15:23:41Z

On 04/02/2012 03:58 PM, Andreas Schwab wrote:

> Pedro Alves <palves@redhat.com> writes:
>
>> I'd be glad to see STARTUP_WITH_SHELL turned into a run-time option. I think there's
>> a PR open for that even. However, we need the shell at least for argument globbing,
>> as in, e.g., debugging `ls *', so I don't think we could make it off by default,
>> which practically renders it an orthogonal feature.
>
> It's actually redirections that are problematic case here (argument
> expansions could be implemented completely independent from starting the
> inferior).

We can't make GDB fully compatible in all cases with what it can do today
if we skip the shell completely. E.g., with "set args $(foo)", "$(foo)" is
expanded by the shell, and what that means is up to the user's shell.
That may mean "invoke the 'foo' program", as in "$(ls)" with sh.
So I'd even inclined to have !STARTUP_WITH_SHELL end up with no
argument expansion (as today).

So, if we made STARTUP_WITH_SHELL a runtime option, and even if we
defaulted it to off, we'd still need to make target code account for
when the user toggled the setting on. So I still claim that that
would be an orthogonal feature, and that GDB should avoid touching
the SHELL process -- it should just PTRACE_CONT it, and nothing else.

--
Pedro Alves