Hi,

Am 20.02.14 16:08, schrieb Mathias Bauer:

Finally I pulled the plug and switched to the trunk version of llvm.
After solving some build problems there I finally got a usable version
of llvm. I compiled libobjc2 with it and tried the ExceptionTest.m
example. It compiles, but doesn't run properly (gets stuck somewhere
below _Unwind_RaiseException).

Now I wonder whether just using the new compiler helps, shouldn't there
be some runtime arrangements also? It seems that symbols are still taken
from the system's version of libgcc_s etc., and these libraries are
built with whatever compiler was used for the system.

Is it really enough to switch the compiler to get the exception handling
on ARM fixed (or at least improved) or does that call for more work?

To supplement this, here's where the execution gets stuck:

void objc_exception_rethrow(struct _Unwind_Exception *e)
{
        struct thread_data *td = get_thread_data_fast();
        // If this is an Objective-C exception, then
        if (td->current_exception_type == OBJC)
        {
                struct objc_exception *ex = objc_exception_from_header(e);
                assert(e->exception_class == objc_exception_class);
                assert(ex == td->caughtExceptions);
                assert(ex->catch_count > 0);
                // Negate the catch count, so that we can detect that this is a
                // rethrown exception in objc_end_catch
                ex->catch_count = -ex->catch_count;
                _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(e);
                free(ex);

(...snip...)

The call to _Unwind_Resume_or_Rethrow(e) does not return.

I tested, that a simple @try/@catch works (an exception thrown in a function called from the @try block is caught successfully and the program exits normally). But throwing another exception in the function that caught the exception freezes the program again. It doesn't matter if the second exception is thrown inside the @catch block or outside of it.

Regards,
Mathias

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to