From: Joel Brobecker <brobecker@adacore.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Xavier Roirand <roirand@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH v2] (Ada) New command to stop at start of exception handlers.
Date: Wed, 20 Dec 2017 04:46:00 -0000 [thread overview]
Message-ID: <20171220044509.kc24ena24t24mfkb@adacore.com> (raw)
In-Reply-To: <834lomptj8.fsf@gnu.org>
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
next prev parent reply other threads:[~2017-12-20 4:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-19 14:30 Xavier Roirand
2017-12-19 16:33 ` Eli Zaretskii
2017-12-20 4:46 ` Joel Brobecker [this message]
2017-12-20 4:29 ` Joel Brobecker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171220044509.kc24ena24t24mfkb@adacore.com \
--to=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=roirand@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox