This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
C++ Exceptions in eCos
- From: Leandro <leandro at hasar dot com>
- To: ecos-discuss at ecos dot sourceware dot org
- Cc: oyvind dot harboe at zylin dot com
- Date: Thu, 04 Mar 2004 13:19:44 -0300
- Subject: [ECOS] C++ Exceptions in eCos
I'm using C++ to develop in eCos (386), and I discovered that gcc's
standard exception handling is not supported. A simple program like this
one:
int
main(void)
{
try { throw 100; } catch(int i) { printf("%d\n", i); }
return 0;
}
produces an unexpected exit. Adding -fexceptions to the compiler flags
doesn't change anything. I have read in the archives that monothreaded
exceptions are supported, but I couldn't make this silly example work
under eCos. In any case, my application is multithreaded, so I would
need the multithreaded exception handling support anyway.
I found Øyvind's patch (being the last thing I heard this one:
http://sources.redhat.com/ml/ecos-discuss/2004-02/msg00446.html), but
even though his patch was not approved because of symbol naming issues,
I couldn't make it work, I have all sorts of linker problems after
patching the gcc and the eCos kernel. What's the current state of this
problem? Is there a working patch I could use to have C++ exceptions,
even though not the final one? If so, what are the exact steps to patch,
compiler flags, etc, to make that example I wrote work correctly? If
not, is someone working on this, and we could expect something in a
reasonable time?
I can provide the steps I followed to patch gcc (3.3.1) and eCos, and
what linker errors I have, if necessary. Thank you very much.
Leandro Fanzone.
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss