This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Warn the user when $SHELL is invalid
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Eli Zaretskii <eliz at gnu dot org>, Doug Evans <dje at google dot com>
- Date: Wed, 29 Jul 2015 15:22:41 -0400
- Subject: Re: [PATCH] Warn the user when $SHELL is invalid
- Authentication-results: sourceware.org; auth=none
- References: <1437761993-18758-1-git-send-email-sergiodj at redhat dot com> <1438113495-10985-1-git-send-email-sergiodj at redhat dot com> <55B80C40 dot 2060901 at redhat dot com>
On Tuesday, July 28 2015, Pedro Alves wrote:
> As mentioned in the other thread, myself, I'm not convinced of the
> value of the extra fork/exit complexity for this. IMO, a wider
> potential bug surface for a not-so-clear benefit. We currently get:
>
> $ SHELL=/nonexisting gdb /home/pedro/a.out
> (gdb) r
> Starting program: /home/pedro/a.out
> Cannot exec /nonexisting -c exec /home/pedro/a.out .
> Error: No such file or directory
> During startup program exited with code 127.
> (gdb)
>
> If we're starting with a shell, then if the exec fails, it was
> obviously because execing the shell failed. I'd suggest simply trying
> to make the error message clearer. E.g.,:
>
> $ SHELL=/nonexisting gdb /home/pedro/a.out
> (gdb) r
> Starting program: /home/pedro/a.out
> "set startup-with-shell" is on, but failed to exec:
> /nonexisting -c exec /home/pedro/a.out
> Error: No such file or directory
> If set, the SHELL environment variable must point at a valid shell.
> SHELL is currently set to "/nonexisting".
> During startup program exited with code 127.
> (gdb)
Yeah, if it's just to warn the user, then I agree that it should be
possible to extend the existing error message. I'll send a patch for
this later.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/