C++ exception not working

Home Forums Forum C++ exception not working

This topic contains 8 replies, has 2 voices, and was last updated by  rich 6 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #27958

    uroni

    Hi,

    with ellcc 0.1.27. Test program:

    #include <stdexcept>
    #include <iostream>
    
    int main()
    {
            try
            {
                    throw std::runtime_error("test");
            }
            catch(std::exception& e)
            {
                    std::cout << "Caught exception: " << e.what() << std::endl;
                    return 0;
            }
            return 1;
    }

    Exception is not caught. Could not see anything obivous missing.
    ecc++ -v -Wl,–verbose shows that it sets -fexceptions, -fcxx-exceptions and it is linked with libunwind.

    Thanks!

    #27983

    rich
    Keymaster

    Hi uroni,
    What processor are you building for?
    -Rich

    #28247

    uroni

    Sorry,

    didn’t work with the targets armv6-linux-engeabihf, x86_64-linux-eng and i386-linux-eng.

    LLVM doesn’t seem to use exceptions and nghttp2 only sparingly, so you might not have noticed.

    #76516

    Alexej Harm

    Hello,

    is this problem being worked on? C++ without exceptions is quite useless in a lot of scenarios.

    Is there a bugzilla or some other bug/issue management for ELLCC?

    If the problem won’t be addressed during the next 1-2 months, I could take a look at it and possibly help.

    Best regards,
    Alexej Harm

    #76775

    Alexej Harm

    This problem still persists in ELLCC 0.1.30.

    #77591

    Alexej Harm

    This problem still persists in ELLCC 0.1.33.

    #77601

    uroni

    @Alexej This is the bug Richard added with regard to this issue: http://ellcc.org/bugzilla/show_bug.cgi?id=78

    It’s probably not easy to fix because libunwind in llvm only works properly with Apple DWARF binaries, but documentation is a bit sparse.

    #79871

    Peter Strempel

    Hello,

    I tested the exception excample from first post with the latest ellcc (2017/08/23), hoping exceptions are working. Unfortunately I cannot get exceptions to be caught, program traps instead:

    1) ellcc 2017/08/23: Trapping
    $ ecc++ testex.cpp
    $ ./a.out
    terminating with uncaught exception of type std::runtime_error: test
    Abgebrochen (Speicherabzug geschrieben)

    2) clang: Catching
    $ clang++ testex.cpp
    $ ./a.out
    Caught exception: test

    Looking at the previously mentioned bugtracker entry, it says the issue is resolved with new build system. To be honest, I have no idea what that means. Is the issue now resolved or not? Do I need to build ellcc myself and enable exception handling? I am using the binary distribution (ellcc install && ellcc install libraries).

    Overall ellcc looks excellent and would be useful for us, unfortuantely we require exception handling, so non working exceptions are currently holding us back from making use of ellcc in our project.

    -Peter

    #79872

    rich
    Keymaster

    I reopened the bug. I was trying to clean up bugs that have been made obsolete by recent changes. I guess I was over zealous.

    -Rich

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.