From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38290 invoked by alias); 25 Apr 2019 13:15:37 -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 38281 invoked by uid 89); 25 Apr 2019 13:15:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=mysterious X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.61.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Apr 2019 13:15:34 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 8C641400C36D9 for ; Thu, 25 Apr 2019 08:15:33 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id JeDthp0Iz2PzOJeDthKXg1; Thu, 25 Apr 2019 08:15:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=jk0D3JSkeF1pMpswn6EaTrggKN0rgMvQ7sMHY4PFgCs=; b=VyALCL6rO2WUG8TA1TiBs6O01L ZSzAykMGjtxw++KF0Z5B8OjrTs6rtoyguI4XKKJpvPSI0WweF1s7ppGakcb1qlO+fibXiLIkWLxBa omK9dI14MHoHRRH2gmOfT2T5z; Received: from 97-122-168-123.hlrn.qwest.net ([97.122.168.123]:55650 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hJeDt-0002cv-AQ; Thu, 25 Apr 2019 08:15:33 -0500 From: Tom Tromey To: Eli Zaretskii Cc: Philippe Waroquiers , gdb-patches@sourceware.org Subject: Re: [RFA] Implement show | set can-call-inferior-functions [on|off] References: <20190423215826.9936-1-philippe.waroquiers@skynet.be> <83sgu73nde.fsf@gnu.org> <1556141127.22002.9.camel@skynet.be> <83bm0u1ult.fsf@gnu.org> Date: Thu, 25 Apr 2019 13:15:00 -0000 In-Reply-To: <83bm0u1ult.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 25 Apr 2019 09:12:30 +0300") Message-ID: <87bm0udy4r.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2019-04/txt/msg00512.txt.bz2 >>>>> "Eli" =3D=3D Eli Zaretskii writes: >> From: Philippe Waroquiers >> Cc: gdb-patches@sourceware.org >> Date: Wed, 24 Apr 2019 23:25:27 +0200 >>=20 >> Generally, returning 0 (or whatever value) can then later on=C2=A0 >> cause problems in a script. >> For example, evaluating some function calls sometimes imply to first >> call malloc in the inferior. When can-call-inferior-functions is off, >> returning 0 (or whatever) from malloc will then cause further problems >> (such as a SEGV). Eli> Then perhaps a built-in variable to test whether inferior calls are Eli> allowed would be of help? Then script writers could look at that Eli> variable and avoid calling inferior functions if they want the script Eli> to continue running regardless, perhaps with reduced functionality. Eli> WDYT? An error definitely seems like the correct thing to do here. Other choices will give silently mysterious behavior. A convenience variable is fine, too, though I suspect it will be little used. I wouldn't require it for this patch to go in. gdb could use better control over the handling of errors. There's a catch/throw patch sitting in bugzilla that would be good to resurrect. Or, the ignore-errors command (implemented in Python) could be checked in. Tom