From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41142 invoked by alias); 20 Dec 2017 04:46:54 -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 39545 invoked by uid 89); 20 Dec 2017 04:45:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Dec 2017 04:45:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 714B2117097; Tue, 19 Dec 2017 23:45:14 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2gwuy2f93pt3; Tue, 19 Dec 2017 23:45:14 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0AF9E11704C; Tue, 19 Dec 2017 23:45:14 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E962D809B4; Wed, 20 Dec 2017 08:45:09 +0400 (+04) Date: Wed, 20 Dec 2017 04:46:00 -0000 From: Joel Brobecker To: Eli Zaretskii Cc: Xavier Roirand , gdb-patches@sourceware.org Subject: Re: [PATCH v2] (Ada) New command to stop at start of exception handlers. Message-ID: <20171220044509.kc24ena24t24mfkb@adacore.com> References: <1513693765-20655-1-git-send-email-roirand@adacore.com> <834lomptj8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <834lomptj8.fsf@gnu.org> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2017-12/txt/msg00440.txt.bz2 Hi Eli, Thanks for the documentation review. > > +When inserting an handle catchpoint on a user-defined > > +exception whose name is identical to one of the exceptions > > +defined by the language, the fully qualified name must be used > > +as the exception name. Otherwise, @value{GDBN} will assume that it > > +should stop on the pre-defined exception rather than the > > +user-defined one. For instance, assuming an exception called > > + @code{Constraint_Error} is defined in package @code{Pck}, then the > > +command to use to catch such exceptions handling is > > +@kbd{catch handle Pck.Constraint_Error}. > > This is OK Texinfo-wise, but I wonder whether this default is useful. > Why not default to the user-defined exception instead in such cases? > (I'm not an Ada programmer, so apologies if this makes no sense.) The default that Xavier describes in the documentation is the behavior we have had for the "catch exception" command for quite a long time, which is not surprising, as the patch simply reuses that code. So he simply "inherits" that behavior. It's extremely rare that a user would define their own exception using the same name as the name of a standard exception. When they do, to use it in their code, they must either qualify the exception name, or else tell the compiler that symbols from the scope where the exception name is defined can be accessed without qualifying. Given those elements, we felt at the time that favoring the system exception over the (rare) user-defined one would be the more useful default most of the time. Either way, it should almost never matters in practice. -- Joel