This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: C++ Exception Handling under eCos
- To: Rosimildo daSilva <rosimildo at hotmail dot com>
- Subject: Re: [ECOS] C++ Exception Handling under eCos
- From: Jonathan Larmour <jlarmour at redhat dot com>
- Date: Thu, 15 Mar 2001 19:53:18 +0000
- Cc: ecos-discuss at sources dot redhat dot com
- Organization: Red Hat UK Ltd.
- References: <F1299n1xxWn9R6mJB5200000c1c@hotmail.com>
Rosimildo daSilva wrote:
>
> >From: "Gunnar Kunz" <gunnar.kunz@ascom.ch>
> >To: <ecos-discuss@sources.redhat.com>
> >Subject: [ECOS] C++ Exception Handling under eCos
> >Date: Thu, 15 Mar 2001 16:37:14 +0100
> >
> >Hi!
> >
> >Can anybody tell me wether C++ exception handling is supported under eCos,
> >or not?
> >In case it is supported, what do I have to do to make it work properly?
> >
>
> No, it is not supported.
>
> To make it to work, it requires some work at GCC level. Basically,
> to make exceptions *thread-safe*, you would need to make some changes
> to GCC. You have to provide some functions that goes to libgcc2.a.
> They are basically provided a global mutex that gets created, and something
> similar to a POSIX key, so each thread get its own context to store the info
> for each exception. I have
> done the work on this area for RTEMS. It is not a picnic in
> the park. :-)
>
> Also, a few extras sections to the linker scripts might be necessary.
> I have not looked too close to the eCos scripts.
Indeed they would in eCos. I've been working somewhat on this, but it's
still work in progress. But as an example, you would need to add a
.eh_frame section. For the linker script, this would mean adding this
fragment to the .ld file in the source repository for your architecture:
#define SECTION_eh_frame(_region_, _vma_, _lma_) \
.eh_frame _vma_ : _lma_ \
{ \
FORCE_OUTPUT; __EH_FRAME_BEGIN__ = .; \
KEEP(*(.eh_frame)) \
__FRAME_END__ = .; \
. = . + 8; \
} > _region_ = 0
You may need to add more sections depending on the target.
> So, I would say that it is not supported today.
>
> But, if you are writing a *single threaded application*, you might
> remove "-fno-exceptions" from the makefiles, and it might work. :-)
Very unlikely due to the above linker script issues.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine