This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] Warn the user when $SHELL is invalid


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/


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