Commit 80be8f05 by Andrew Haley

i386-signal.h (MAKE_THROW_FRAME): Advance EIP by two bytes to make it point…

i386-signal.h (MAKE_THROW_FRAME): Advance EIP by two bytes to make it point after the instruction where the trap...

1999-07-07  Andrew Haley  <aph@cygnus.com>
        * include/i386-signal.h (MAKE_THROW_FRAME): Advance EIP by two
	bytes to make it point after the instruction where the trap
	occurred.
	(HANDLE_DIVIDE_OVERFLOW): Ditto.

From-SVN: r27989
parent 09522f21
...@@ -33,6 +33,11 @@ do \ ...@@ -33,6 +33,11 @@ do \
register unsigned long _ebp = _regs->ebp; \ register unsigned long _ebp = _regs->ebp; \
register unsigned char *_eip = (unsigned char *)_regs->eip; \ register unsigned char *_eip = (unsigned char *)_regs->eip; \
\ \
/* Advance the program counter so that it is after the start of the \
instruction: the x86 exception handler expects \
the PC to point to the instruction after a call. */ \
_eip += 2; \
\
asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \ asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
: : "r"(_ebp), "r"(_eip)); \ : : "r"(_ebp), "r"(_eip)); \
} \ } \
...@@ -57,7 +62,7 @@ do \ ...@@ -57,7 +62,7 @@ do \
* As the instructions are variable length it is necessary to do a \ * As the instructions are variable length it is necessary to do a \
* little calculation to figure out where the following instruction \ * little calculation to figure out where the following instruction \
* actually is. \ * actually is. \
\ \
*/ \ */ \
\ \
if (_eip[0] == 0xf7) \ if (_eip[0] == 0xf7) \
...@@ -99,6 +104,14 @@ do \ ...@@ -99,6 +104,14 @@ do \
_eip = (unsigned char *)_ebp[1]; \ _eip = (unsigned char *)_ebp[1]; \
_ebp = (unsigned long *)_ebp[0]; \ _ebp = (unsigned long *)_ebp[0]; \
} \ } \
else \
{ \
/* Advance the program counter so that it is after the start \
of the instruction: this is because the x86 exception \
handler expects the PC to point to the instruction after a \
call. */ \
_eip += 2; \
} \
} \ } \
\ \
asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \ asm volatile ("mov %0, (%%ebp); mov %1, 4(%%ebp)" \
...@@ -118,9 +131,9 @@ do \ ...@@ -118,9 +131,9 @@ do \
} \ } \
while (0) while (0)
#define INIT_FPE \ #define INIT_FPE \
do \ do \
{ \ { \
arithexception = new java::lang::ArithmeticException \ arithexception = new java::lang::ArithmeticException \
(JvNewStringLatin1 ("/ by zero")); \ (JvNewStringLatin1 ("/ by zero")); \
struct sigaction act; \ struct sigaction act; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment