harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r616841 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
Date Wed, 30 Jan 2008 18:45:38 GMT
Author: gshimansky
Date: Wed Jan 30 10:45:37 2008
New Revision: 616841

URL: http://svn.apache.org/viewvc?rev=616841&view=rev
Log:
Applied patch from HARMONY-5415
[drlvm][signals] Crash handler doesn't print stack trace when crash happens in VM _unwindable_
code

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp?rev=616841&r1=616840&r2=616841&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp Wed Jan 30 10:45:37 2008
@@ -26,6 +26,7 @@
 #include "jit_intf_cpp.h"
 #include "Class.h"
 #include "class_member.h"
+#include "exceptions.h"
 #include "stack_trace.h"
 #include "interpreter_exports.h"
 #include "cci.h"
@@ -401,25 +402,26 @@
 
         jthread java_thread = jthread_get_java_thread(thread);
         JNIEnv* jni_env = vm_thread->jni_env;
-        jstring name;
-        char* java_name = NULL;
 
         if (java_thread)
         {
             jclass cl = GetObjectClass(jni_env, java_thread);
             jmethodID id = jni_env->GetMethodID(cl, "getName","()Ljava/lang/String;");
-            name = jni_env->CallObjectMethod(java_thread, id);
-            java_name = (char*)jni_env->GetStringUTFChars(name, NULL);
-        }
+            jstring name = jni_env->CallObjectMethod(java_thread, id);
+            char* java_name = (char*)jni_env->GetStringUTFChars(name, NULL);
 
-        fprintf(stderr, "%s[%p]  '%s'\n",
-                (cur_thread && vm_thread == cur_thread) ? "--->" : "    ",
-                thread->os_handle,
-                java_name ? java_name : "");
+            fprintf(stderr, "%s[%p]  '%s'\n",
+                    (cur_thread && vm_thread == cur_thread) ? "--->" : "    ",
+                    thread->os_handle, java_name);
 
-        if (java_thread)
             jni_env->ReleaseStringUTFChars(name, java_name);
-
+        }
+        else
+        {
+            fprintf(stderr, "%s[%p]\n",
+                    (cur_thread && vm_thread == cur_thread) ? "--->" : "    ",
+                    thread->os_handle);
+        }
     }
 
     hythread_iterator_release(&it);
@@ -439,6 +441,7 @@
         return;
 
     hymutex_lock(sd_lock);
+    bool unwindable = set_unwindable(false); // To call Java code
 
     // Print register info
     print_reg_state(regs);
@@ -485,6 +488,8 @@
 
     fprintf(stderr, "<end of stack trace>\n");
     fflush(stderr);
+
+    set_unwindable(unwindable);
 
     // Do not unlock to prevent other threads from printing crash stack
     //hymutex_unlock(sd_lock);



Mime
View raw message