LEON2 and C++ exception handling

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Aug 11 08:40:09 UTC 2017


On 11/08/17 10:36, Mike Looijmans wrote:

> Now that we got RTEMS running from ROM on a LEON2, I'm running into 
> the issue that C++ exceptions don't work. Any "throw" results in a 
> fatal termination.
>
> A program that does something like:
>
> try {
>   throw std::exception();
> } catch (const std::exception& ex)
>   puts(ex.what());
> }
>
> results in a stack trace like this:
>
>
>   #0   0xf9404fcc   0x4000c5a8
>   #1   0x00079340   0x4000c608   <_CPU_Fatal_halt+0x8>
>   #2   0x0005497c   0x4000c668   <_Terminate+0x48>
>   #3   0x000535b8   0x4000c6d8   <rtems_fatal+0xc>
>   #4   0x0004a970   0x4000c738   <bsp_spurious_handler+0xc>
>   #5   0x00079588   0x4000c7a0
>   #6   0x00048720   0x40017ab8 <classify_object_over_fdes+0xd0>
>   #7   0x00048e78   0x40017bd0   <search_object+0x330>
>   #8   0x0004965c   0x40017c48   <_Unwind_Find_FDE+0x10c>
>   #9   0x00045f30   0x40017cb0   <uw_frame_state_for+0x3c>
>   #10  0x0004739c   0x40017d18   <uw_init_context_1+0x28>
>   #11  0x00047c44   0x400180f0 <_Unwind_RaiseException+0x10>
>   #12  0x0000b478   0x40018918   <__cxa_throw+0x58>
>
>
> Any tips on how to diagnose this? Or should I just give up on C++ 
> exception with RTEMS? 

You must provide a window flush trap. Something is wrong with your trap 
table. It works with the standard BSPs.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list