This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

throw c++ exceptions from signal handler and -fnon-call-exceptions


Hi all,

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.

BTW: I first asked this question to Java list but got no response. So I
resend it here and sorry for the spam.

Thanks a lot


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]