* interpret-run.cc (NEXT_INSN)[DEBUG]: Advance PC before
authorkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 May 2007 02:50:02 +0000 (02:50 +0000)
committerkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 May 2007 02:50:02 +0000 (02:50 +0000)
        executing the instruction.
        * include/java-interp.h (_Jv_InterpFrame::get_pc): Subtract
        one insn from the frame's PC. _Jv_InterpMethod::run et al
        will advance the PC before executing the instruction.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124313 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/include/java-interp.h
libjava/interpret-run.cc

index a66338c..c8c9aa5 100644 (file)
@@ -1,3 +1,11 @@
+2007-04-30  Keith Seitz  <keiths@redhat.com>
+
+       * interpret-run.cc (NEXT_INSN)[DEBUG]: Advance PC before
+       executing the instruction.
+       * include/java-interp.h (_Jv_InterpFrame::get_pc): Subtract
+       one insn from the frame's PC. _Jv_InterpMethod::run et al
+       will advance the PC before executing the instruction.
+
 2007-04-27  Keith Seitz  <keiths@redhat.com>
 
        * classpath/lib/gnu/classpath/jdwp/Jdwp.class: Regenerated.
index 8da0584..4bded04 100644 (file)
@@ -465,7 +465,7 @@ public:
     else
       pc = *pc_ptr;
     
-    return pc;
+    return pc - 1;
   }
 };
 
index f99ff5c..f951981 100644 (file)
@@ -348,15 +348,16 @@ details.  */
 #define NEXT_INSN                                                      \
   do                                                                   \
     {                                                                  \
+      pc_t insn = pc++;                                                        \
       if (JVMTI_REQUESTED_EVENT (SingleStep))                          \
        {                                                               \
          JNIEnv *env = _Jv_GetCurrentJNIEnv ();                        \
          jmethodID method = meth->self;                                \
-         jlocation loc = meth->insn_index (pc);                        \
+         jlocation loc = meth->insn_index (insn);                      \
          _Jv_JVMTI_PostEvent (JVMTI_EVENT_SINGLE_STEP, thread,         \
                               env, method, loc);                       \
        }                                                               \
-      goto *((pc++)->insn);                                            \
+      goto *(insn->insn);                                              \
     }                                                                  \
   while (0)