Kövesdi György wrote:
I built an environment for my 68020 board using gcc-4.0.2 and
newlib-1.13.0. Everything seems good, but the exception handling is not
working.

Getting EH to work for a newlib using target board may be complicated.

How EH works depends on whether you are using DWARF2 unwind info, or builtin setjmp and longjmp.

The builtin setjmp and longjmp approach is easier to get working, but has a higher run time overhead when no exceptions are thrown. In this scheme, we effectively execute a builtin setjmp everytime you enter an EH region, and a throw is just a builtin longjmp call. This should work correctly if builtin_setjmp and builtin_longjmp are working correctly. See the docs for these builtin functions.

The DWARF2 unwind info method has little or no overhead until a exception is thrown. This is the preferred method for most targets. In this scheme, we read the DWARF2 unwind info from the executable when an exception is throw, parse the unwind tables, and then follow the directions encoded in the unwind tables until we reach a catch handler. This approach has obvious problems if you are using a disk-less OS-less target board. This approach also generally requires some C library support, which is present in glibc, but may not be present in newlib. You can find info on this approach here
    http://gcc.gnu.org/ml/gcc/2004-03/msg01779.html
--
Jim Wilson, GNU Tools Support, http://www.specifix.com

Reply via email to