Re: Structured exception information



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
.



Relevant Pages

  • Virgin USB modem for Mobile Broadband in Australia - F10 Network Manager crash
    ... TypeError: exceptions must be classes, instances, or strings, not NotImplementedType ... Traceback: ...
    (Fedora)
  • F10 Network Manager crashes using "Edit" on ttyUSB0
    ... Traceback: ... TypeError: exceptions must be classes, instances, or strings, not NotImplementedType ...
    (Fedora)
  • Re: GPRS Connection
    ... It's the file with the strings that describe the various exceptions that a ... if you want a message that interprets ... the exception into a human-readable format, you need the localized strings ... You can get more detailed error information by installing this CAB. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Playing With Fingers - p i or i m
    ... I tend towards classical technique. ... strings and my index, middle, and ring fingers on the top 3. ... Some exceptions are just for ... So the 'general rule' is often broken. ...
    (alt.guitar.beginner)
  • Re: How to tell the difference between string and list
    ... > making other assumptions based on isstringlike? ... especially given the sequence-ness of strings, ... sometimes that's just the problem: exceptions *won't* get ...
    (comp.lang.python)