From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41183 invoked by alias); 17 Aug 2018 16:03:30 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 41172 invoked by uid 89); 17 Aug 2018 16:03:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_NUMSUBJECT,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Aug 2018 16:03:28 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 85FCB8197022; Fri, 17 Aug 2018 16:03:27 +0000 (UTC) Received: from blade.nx (ovpn-117-165.ams2.redhat.com [10.36.117.165]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53C1010EE6D5; Fri, 17 Aug 2018 16:03:27 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id B3DE1801A154; Fri, 17 Aug 2018 17:03:26 +0100 (BST) Date: Fri, 17 Aug 2018 16:03:00 -0000 From: Gary Benson To: Ruslan Kabatsayev Cc: psmith@gnu.org, gdb@sourceware.org Subject: Re: gdb -batch always exits with status 0 Message-ID: <20180817160325.GA12274@blade.nx> References: <20180705144659.GA29169@blade.nx> <2c7ad73e90cc7417bd23b4529261d8c737668571.camel@gnu.org> <20180817110354.GB32726@blade.nx> <20180817152345.GA2920@blade.nx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00038.txt.bz2 Ruslan Kabatsayev wrote: > On Fri, 17 Aug 2018 at 18:23, Gary Benson wrote: > > > > It would be the least impactful way, sure, but my point is that > > GDB doesn't operate in an intuitive way, and my view is that > > whatever is intuitive should be the default. Having to request it > > with a special flag makes GDB harder for new users. > > Not sure about intuitiveness of early exit, but we have an example > of the converse: bash (and other shells). Namely, by default it > executes all the commands, exits with the exit status of the last > command executed. But you can `set -e`, and then first failing > command will stop processing. But then, there do exist means to > suppress failure (e.g. `badCommand && true`), which GDB doesn't seem > to have. Shells are the only example I could think of. And I wonder what proportion of shell scripts start with 'set -e' :) Having to add that is the kind of thing I mean about making things harder for new users. Cheers, Gary