[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: Exception handling
Michel Hack (1-914-784-7648) <hack@xxxxxxxxxxxxxx> wrote:
With respect to 754R non-resumable "ThrowException", David Hough wrote:
As the text emphasizes, results in interrupted
calculations need not be determinate or reproducible.
That's not the problem Nick and I were addressing. The problem lies
below the abstractions (such as variables) exposed by the language.
Yes. I did mention the optimisation issues, but they are still below
the horizon that is visible to the programmer. The fundamental ones
were the ones you mention.
For example, at the physical point of interruption, typically several
instructions beyond the logical point (in systems without a precise
interrupt mode or capability), a stack frame may have been partially
unwound. It is even possible that two frames were unwound, or that
a new frame was already (perhaps partially) activated.
Indeed. I saw one arise 4-5 frames away with a 0C5 on a 370/165
(one up and two down), and one on a vector machine that was so far
away from its origin I couldn't work out where it originated. Both
were for manual debugging, of course, but a handler would have to
work that out automatically.
My guess is that the CPUs that fix up floating-point operations
in software provide a truly horrible interface to the kernel to
do the fixing up, because I have never seen a specification of it
for a modern design. It is very likely that it says "no general
registers may be changed" (as the exception might be raised out of
order), which would make an application-level throw unimplementable.
Reverse engineering architectures from the source of the Linux
kernel is a task for my retirement ....
I really don't see an option except to provide a trap barrier at the
start and end of the block. And damn the cost.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@xxxxxxxxx
Tel.: +44 1223 334761 Fax: +44 1223 334679