Hi Eljay,
when I established my compiler ,I set my configure options as:
../gcc-4.1-20060407/configure --target=sh-elf --host=i686-pc-cygwin
--build=i686-pc-cygwin --prefix=$PREFIX --with-newlib --with-gnu-as
--with-gnu-ld --enable-threads --enable-languages=c,c++
--enable-version-specific-runtime-libs --enable-sjlj-exceptions
My program is a c++ program ,and uses etry/throw/catch.I tried to compile
my program with GCC,you know,with "--enable-sjlj-exceptions" configured,
the compiler will process the exception with a setjmp/longjmp mechanism.but
My program crashed.
Should I try the other exception handling mechanism "dwarf2 mechanism" ?
If I want to try,only need I change the "--enable-sjlj-exceptions" as
"--with-dwarf2"?
thank you !
Sincerely,
--David
From: John Love-Jensen <eljay@xxxxxxxxx>
To: 王 刚伟 <gwwang10@xxxxxxxxxxx>, MSX to GCC
<gcc-help@xxxxxxxxxxx>
Subject: Re: __builtin_setjmp/__builtin_longjmp Implementation
Implementation
Date: Fri, 02 Feb 2007 05:51:48 -0600
Hi David,
> My program about exception handle crashs ,when "longjmp" is called to
> restore context,and registers are not restored correctly.
Is your program a C program? A C++ program?
If it is a C++ program, are you using C++ exceptions (try/throw/catch)?
If
you are using C++ exceptions, you cannot interleave C++ exceptions and
setjmp/longjmp.
Are you using the volatile qualifier on stack variables outside the
context
of the setjmp, if they are used within the context of the body of the
setjmp?
Without more information, it will be very difficult to diagnose the
problem
you are experiencing.
Sincerely,
--Eljay
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn