summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Haley <aph@cygnus.com>1999-07-07 10:53:17 +0000
committerTom Tromey <tromey@gcc.gnu.org>1999-07-07 10:53:17 +0000
commit13789ab809cf7b018c6b31184eb4171b7b965ed1 (patch)
treec77901a80b8bbefa953a8181ff2c214c3585f01e
parent5831448df335110a3de385472070677b23d0f84d (diff)
downloadgcc-13789ab809cf7b018c6b31184eb4171b7b965ed1.tar.gz
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: r27995
-rw-r--r--libjava/ChangeLog7
-rw-r--r--libjava/include/i386-signal.h19
2 files changed, 23 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 722b9fca552..1a22afb9275 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
1999-07-07 Tom Tromey <tromey@cygnus.com>
* mauve-libgcj: Explicitly enable formerly disabled java.text
diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
index 51a94f92da2..ddb66bea125 100644
--- a/libjava/include/i386-signal.h
+++ b/libjava/include/i386-signal.h
@@ -33,6 +33,11 @@ do \
register unsigned long _ebp = _regs->ebp; \
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)" \
: : "r"(_ebp), "r"(_eip)); \
} \
@@ -57,7 +62,7 @@ do \
* As the instructions are variable length it is necessary to do a \
* little calculation to figure out where the following instruction \
* actually is. \
- \
+ \
*/ \
\
if (_eip[0] == 0xf7) \
@@ -99,6 +104,14 @@ do \
_eip = (unsigned char *)_ebp[1]; \
_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)" \
@@ -118,9 +131,9 @@ do \
} \
while (0)
-#define INIT_FPE \
+#define INIT_FPE \
do \
- { \
+ { \
arithexception = new java::lang::ArithmeticException \
(JvNewStringLatin1 ("/ by zero")); \
struct sigaction act; \