- SGI irix
- PC-NT (professional)
- PC-Linux
and have found a peculiar problem with the Linux version:
Whenever an exception gets thrown from within the Xt main event loop
(i.e., somewhere on the stack after the call to XtAppMainLoop() ), the
default exception handler gets called even though the a catch for both
our own error handler (EUtl) and any other catch(...) resides just
after the call to XtAppMainLoop().
We're wondering if this is a known problem with the Xt lib under Linux,
something with gcc, or maybe the Xm library? The same code compiled
under irix works just fine. Any advice would be helpful.
Thanks - David
Hmmmm. When I last looked at XFree86, Xt was C code. Exception
handling, try, throw, catch style is C++. I am intrigued to know how
the other systems manage to generate a C++ exception that you can
catch.
I understand that Windows has some sort of mechanism that uses C++
exceptions to handle signals, but that is entirely non-standard - and
not even a very good idea.
This is from the XFree86 version 4.10 source for Xt in Error.c:
/* The error handlers in the application context aren't used since we
can't
come up with a uniform way of using them. If you can, define
GLOBALERRORS to be FALSE (or 0). */
It is also doubtful that you can throw an exception through a layer of
C code between two C++ functions. I will test this, and get back.
So basically, it would appear that what you are trying probably cannot
be done.
Brenton