From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43029 invoked by alias); 29 Jul 2015 19:22:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 43017 invoked by uid 89); 29 Jul 2015 19:22:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 29 Jul 2015 19:22:44 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id E38B38EB44; Wed, 29 Jul 2015 19:22:42 +0000 (UTC) Received: from localhost (unused-10-15-17-51.yyz.redhat.com [10.15.17.51]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6TJMgc9003650 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 29 Jul 2015 15:22:42 -0400 From: Sergio Durigan Junior To: Pedro Alves Cc: GDB Patches , Eli Zaretskii , Doug Evans Subject: Re: [PATCH] Warn the user when $SHELL is invalid References: <1437761993-18758-1-git-send-email-sergiodj@redhat.com> <1438113495-10985-1-git-send-email-sergiodj@redhat.com> <55B80C40.2060901@redhat.com> X-URL: http://blog.sergiodj.net Date: Wed, 29 Jul 2015 19:22:00 -0000 In-Reply-To: <55B80C40.2060901@redhat.com> (Pedro Alves's message of "Wed, 29 Jul 2015 00:12:00 +0100") Message-ID: <873806ixa6.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00884.txt.bz2 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/