Re: Structured exception information
- From: Stephen Leake <stephen_leake@xxxxxxxxxxxxxxxx>
- Date: Sun, 21 Jan 2007 17:42:44 -0500
Robert A Duff <bobduff@xxxxxxxxxxxxxxxxxxxx> writes:
Stephen Leake <stephen_leake@xxxxxxxxxxxxxxxx> writes:
1) Define structured exceptions in Ada. We _know_ that _all_ compilers
will not meet the standard in some way, and each in different ways.
I'm confused by that statement. Are you merely saying that "compilers
have bugs"? It's (sadly) true, but that's not a valid criticism of this
particular feature. Or are you saying there's something specific about
the "exceptions as objects" feature we're discussing that makes it hard
(impossible?!) to implement, and therefore buggy?
The latter. But apparently I'm wrong, given the current state of the art.
It's certainly more difficult to implement data attached to
exceptions, compared to the Ada 83 feature, where an exception can be
represented as a fixed-size (one word) compile- or link-time-known
quantity. Managing variable sized things is definitely harder.
But I fail to see how exceptions with Strings attached (he he)
is easier to implement than exceptions with arbitrary (typed) data
attached.
This is related to an issue that you raised earlier; in Ada 2005 there
is a limit of 200 characters on the string. I believe that is because
exceptions with Strings must work even when the exception is
Storage_Error due to either heap exhaustion or stack overflow.
You can't allocate space for the attached data at the point of the
exception; you have to allocate a 200 byte buffer somewhere (in
per-task space?) ahead of time, in case an exception is raised.
(a side note: 200 is arbitary; we need a pragma Exception_Data_Size,
which would default to 200.)
It's much better to trucate a String to 200 bytes than some
user-defined type. I supposed fixed-size user-defined types that are
smaller than 200 bytes could work. But I don't see how to allow
dynamically sized data.
--
-- Stephe
.
- Follow-Ups:
- Re: Structured exception information
- From: Robert A Duff
- Re: Structured exception information
- References:
- Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Maciej Sobczak
- Re: Structured exception information
- From: Stephen Leake
- Re: Structured exception information
- From: Robert A Duff
- Structured exception information
- Prev by Date: Re: Structured exception information
- Next by Date: Help: program won't ends (GNAT)
- Previous by thread: Re: Structured exception information
- Next by thread: Re: Structured exception information
- Index(es):
Relevant Pages
|