harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ibere...@apache.org
Subject svn commit: r930773 - in /harmony/enhanced/java/trunk/drlvm/vm: port/src/crash_handler/ port/src/modules/unix/freebsd/ vmcore/src/util/ vmcore/src/util/em64t/base/ vmcore/src/util/ia32/base/
Date Mon, 05 Apr 2010 00:56:34 GMT
Author: iberezhn
Date: Mon Apr  5 00:56:34 2010
New Revision: 930773

URL: http://svn.apache.org/viewvc?rev=930773&view=rev
Log:
Fixed Java frames reporting in crash stack (FreeBSD); added native-to-managed stubs

Modified:
    harmony/enhanced/java/trunk/drlvm/vm/port/src/crash_handler/stack_dump.cpp
    harmony/enhanced/java/trunk/drlvm/vm/port/src/modules/unix/freebsd/native_modules_procmap.c
    harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/crash_dump.cpp
    harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/em64t/base/ini_em64t.cpp
    harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp

Modified: harmony/enhanced/java/trunk/drlvm/vm/port/src/crash_handler/stack_dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/drlvm/vm/port/src/crash_handler/stack_dump.cpp?rev=930773&r1=930772&r2=930773&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/drlvm/vm/port/src/crash_handler/stack_dump.cpp (original)
+++ harmony/enhanced/java/trunk/drlvm/vm/port/src/crash_handler/stack_dump.cpp Mon Apr  5
00:56:34 2010
@@ -182,11 +182,19 @@ static void sd_print_stack(Registers* re
         CFunInfo cfi = {0};
         native_module_t* module = port_find_module(uwcontext.modules, locregs.get_ip());
         sd_get_c_method_info(&cfi, module, locregs.get_ip());
-        sd_print_c_line(stderr, framenum++, &locregs, &cfi);
 
-        if (unwind && uwresult < 0 && uwinfo.method_name)
-        { // VM has not unwound but has provided additional frame info
-            sd_print_vm_line(stderr, -1, NULL, &uwinfo); // Print as additional info
+        if (!*cfi.name && unwind && uwresult < 0 && uwinfo.method_name)
+        { // No native but some VM info, so print VM info as main info
+            sd_print_vm_line(stderr, framenum++, &locregs, &uwinfo);
+        }
+        else
+        {
+            sd_print_c_line(stderr, framenum++, &locregs, &cfi);
+
+            if (unwind && uwresult < 0 && uwinfo.method_name)
+            { // VM has not unwound but has provided additional frame info
+                sd_print_vm_line(stderr, -1, NULL, &uwinfo); // Print as additional info
+            }
         }
 
         if (!hasnative) // Native unwinding is not initialized

Modified: harmony/enhanced/java/trunk/drlvm/vm/port/src/modules/unix/freebsd/native_modules_procmap.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/drlvm/vm/port/src/modules/unix/freebsd/native_modules_procmap.c?rev=930773&r1=930772&r2=930773&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/drlvm/vm/port/src/modules/unix/freebsd/native_modules_procmap.c
(original)
+++ harmony/enhanced/java/trunk/drlvm/vm/port/src/modules/unix/freebsd/native_modules_procmap.c
Mon Apr  5 00:56:34 2010
@@ -35,7 +35,7 @@ int port_modules_procmap_readline(FILE* 
             char* pacc_r, char* pacc_x, char* filename)
 {
     char buf[PATH_MAX];
-    char type[64];
+    char acc_w;
 
     if (!map || feof(map))
         return -1;
@@ -43,14 +43,17 @@ int port_modules_procmap_readline(FILE* 
     if (!fgets(buf, sizeof(buf), map))
         return -1;
 
-    int res = sscanf(buf, "%" PI_FMT "x %" PI_FMT "x %*d %*d %*" PI_FMT "x %c%*c%c %*d %*d
%*x %*s %*s %s %s",
-                    pstart, pend, pacc_r, pacc_x, type, filename);
+    int res = sscanf(buf, "%" PI_FMT "x %" PI_FMT "x %*d %*d %*" PI_FMT "x %c%c%c %*d %*d
%*x %*s %*s %*s %s",
+                    pstart, pend, pacc_r, &acc_w, pacc_x, filename);
 
-    if (res < 5 || strcmp(type, "vnode") != 0)
+    if (res < 5)
         return 0;
 
     if (res == 6 && filename[0] == '-' && filename[1] == '\0')
         filename[0] = 0;
 
+    if (*pacc_r == '-' && acc_w == '-' && *pacc_x == '-')
+        return 0; // Skip these useless regions that may separate parts of one module
+
      return res - 1;
 }

Modified: harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/crash_dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/crash_dump.cpp?rev=930773&r1=930772&r2=930773&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/crash_dump.cpp (original)
+++ harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/crash_dump.cpp Mon Apr  5 00:56:34
2010
@@ -198,6 +198,7 @@ static int unwind_compiled_frame(Registe
     Global_Env* env = VM_Global_State::loader_env;
     bool ip_past = !uwinfo->is_first;
     uwinfo->is_first = false; // For the next iterations
+    bool was_java = (uwinfo->cci != NULL);
 
     // Stubs - return stub name as additional info
     if (native_is_ip_stub(cur_ip))
@@ -205,6 +206,9 @@ static int unwind_compiled_frame(Registe
         sfi->method_class_name = "stub";
         sfi->method_name = native_get_stub_name_nocpy(cur_ip);
 
+        if (was_java)
+            return -1; // N2M frame, do not unwind
+
         if (uwinfo->lm2n == NULL) // Initialize
             uwinfo->lm2n = m2n_get_last_frame(vmthread);
 

Modified: harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/em64t/base/ini_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/em64t/base/ini_em64t.cpp?rev=930773&r1=930772&r2=930773&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/em64t/base/ini_em64t.cpp (original)
+++ harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/em64t/base/ini_em64t.cpp Mon Apr
 5 00:56:34 2010
@@ -35,6 +35,7 @@
 #include "lil_code_generator_utils.h"
 #include "jit_runtime_support_common.h"
 
+#include "compile.h"
 #include "dump.h"
 
 #if defined(WIN32) || defined(_WIN64)
@@ -191,6 +192,8 @@ static invoke_managed_func_int_t gen_inv
 
     assert(stub - (char *)func <= STUB_SIZE);
 
+    compile_add_dynamic_generated_code_chunk("invoke_managed_func", false, (void*)func, stub
- (char*)func);
+
     DUMP_STUB(func, "invoke_managed_func", stub - (char *)func);
 
     return func;

Modified: harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp?rev=930773&r1=930772&r2=930773&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp (original)
+++ harmony/enhanced/java/trunk/drlvm/vm/vmcore/src/util/ia32/base/ini_iA32.cpp Mon Apr  5
00:56:34 2010
@@ -139,6 +139,8 @@ static IntFuncPtr gen_invoke_int_managed
     
     assert(stub - (char *)func <= STUB_SIZE);
 
+    compile_add_dynamic_generated_code_chunk("invoke_int_managed_func", false, (void*)func,
stub - (char*)func);
+
     DUMP_STUB(func, "invoke_int_managed_func", stub - (char *)func);
     return func;
 }
@@ -166,6 +168,8 @@ static FloatFuncPtr gen_invoke_float_man
     
     assert(stub - (char *)func <= STUB_SIZE);
 
+    compile_add_dynamic_generated_code_chunk("invoke_float_managed_func", false, (void*)func,
stub - (char*)func);
+
     DUMP_STUB(func, "invoke_float_managed_func", stub - (char *)func);
     return func;    
 }
@@ -193,6 +197,8 @@ static DoubleFuncPtr gen_invoke_double_m
     
     assert(stub - (char *)func <= STUB_SIZE);
 
+    compile_add_dynamic_generated_code_chunk("invoke_double_managed_func", false, (void*)func,
stub - (char*)func);
+
     DUMP_STUB(func, "invoke_double_managed_func", stub - (char *)func);
     return func;
     



Mime
View raw message