Forum Discussion
Altera_Forum
Honored Contributor
14 years agoSuccess! FWIW, I resolved this issue and now the basic RTEMS C++ exceptions tests pass w/o issues. It turns out that there were no issues so far with the Altera extensions to gcc for nios2, but instead with the RTEMS specific configurations of the nios2 cross gcc. I needed only to add "builtin_define ("__USE_INIT_FINI__");" to "<gcc>/gcc/config/nios2/rtems.h" to make the C++ exception unwinding work correctly.
I should add that the combination of ddd with nios2-elf-gdb works very nicely for debugging rtems startup issues. Initially I was confused about what location in the source was failing because the optimized gcc startup code was integrating/optimizing away inline functions. With ddd I can see both the source window and the machine instruction window simultaneously and then its easy to see what is happening!