You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2006/12/28 16:45:12 UTC

svn commit: r490742 - /harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp

Author: gshimansky
Date: Thu Dec 28 07:45:11 2006
New Revision: 490742

URL: http://svn.apache.org/viewvc?view=rev&rev=490742
Log:
Applied HARMONY-2890 [drlvm][port] A smoke test detects issues on stack unwinding.

Tests passed on windows 2003 server. Since bug is win32 specific, other platforms not tested. Smoke tests work in release mode too.


Modified:
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp?view=diff&rev=490742&r1=490741&r2=490742
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/ia32/pim/stack_iterator_ia32.cpp Thu Dec 28 07:45:11 2006
@@ -421,43 +421,18 @@
  *
  * See also function: JIT_execute_method_default
  */
-void cpp_set_last_frame(M2nFrame* lm2nf)
+static void cpp_check_last_frame()
 {
-    TRACE2("exn",("Unwinding.... lm2nf=0x%08x\n", lm2nf));
     void *handler;
     __asm {
         mov eax, fs:[0]
         mov handler, eax
     }
 
-    TRACE2("exn",(" handler=0x%p\n", handler));
-    if (!(handler < lm2nf)) {
-        return;
-    }
-
-    // finding lastFrame > lm2nf, should be last
     void *lastFrame = p_TLS_vmthread->lastFrame;
-    TRACE2("exn",("  curr = 0x%p\n", lastFrame));
 
-    if (!(lastFrame < lm2nf)) {
-        printf("Unwinding:  Lost lastFrame\n");
-        __asm { int 3 }
-    }
-
-    while(true) {
-        void *prevFrame = *(void**)lastFrame;
-        TRACE2("exn",("  prev = 0x%p\n", prevFrame));
-        if (prevFrame == 0) {
-            break;
-        }
-        if (prevFrame < lm2nf) {
-            fprintf(stderr, "ERROR:  Unwinding native code! Error\n");
-            __asm { int 3 }
-        } else {
-            break;
-        }
-        lastFrame = prevFrame;
-    }
+    TRACE2("exn",("  curr = 0x%p\n", lastFrame));
+    TRACE2("exn",(" handler=0x%p\n", handler));
 
     if (!(handler < lastFrame)) {
         TRACE2("exn",("all ok\n"));
@@ -508,7 +483,7 @@
     m2n_set_last_frame(local_si.m2nfl);
 #ifdef _WIN32 // Workaround and detection of possible problems with
               // objects on stack.
-    cpp_set_last_frame(local_si.m2nfl);
+    cpp_check_last_frame();
 #endif // _WIN32
 
     TRACE2("exn", ("generating control transfer stub"));