This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: throw c++ exceptions from signal handler and -fnon-call-exceptions
- From: Ian Lance Taylor <iant at google dot com>
- To: "Chen, Miaobo" <miaobo dot chen at intel dot com>
- Cc: <libstdc++ at gcc dot gnu dot org>
- Date: 14 Jun 2006 07:59:52 -0700
- Subject: Re: throw c++ exceptions from signal handler and -fnon-call-exceptions
- References: <8BF50482CE9EE245902340E0724784D58160C7@pdsmsx411.ccr.corp.intel.com>
"Chen, Miaobo" <miaobo.chen@intel.com> writes:
> I saw an example in libjava/include/i386_signal.h, in macro
> MAKE_THROW_FRAME, upon trapping instructions we advance eip by 2 and
> throw C++ exceptions from signal handler. My question is:
>
> Why we advance eip by a fixed value 2 here? Does this work for any
> trapping instructions for invalid memory access on ia32? I tested with:
>
> __asm__ ("movl $0x4,0xffffffe8(%eax)"); //suppose eax=0 for invalid
> memory access
>
> which is a 7 bytes instruction but looks it does not work anymore,
> neither did when advancing eip by 2 or 7.
In current mainline, MAKE_THROW_FRAME in libjava/include/i386-signal.h
does nothing. According to the ChangeLog, the patch was made for
http://gcc.gnu.org/PR26208
Ian