harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r541322 - in /harmony/enhanced/drlvm/trunk: build/make/excludes/ vm/include/ vm/interpreter/src/ vm/vmcore/src/stack/
Date Thu, 24 May 2007 15:26:46 GMT
Author: gshimansky
Date: Thu May 24 08:26:45 2007
New Revision: 541322

URL: http://svn.apache.org/viewvc?view=rev&rev=541322
Log:
Fixed bug in HARMONY-3585 [drlvm][jni] shutdown.TestFatalError fails on interpreter

The patch changes interface with interpreter to pass file descriptor instead of FILE* to stack_dump
functions. This workarounds the problem on windows that recognizes stdout in different DLLs
differently.


Modified:
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int
    harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
    harmony/enhanced/drlvm/trunk/vm/include/interpreter_exports.h
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int (original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86.int Thu
May 24 08:26:45 2007
@@ -7,9 +7,6 @@
 # HARMONY-2977
 io/Integers.java
 
-# HARMONY-3585
-shutdown/TestFatalError.java
-
 # HARMONY-3917
 gc/PhantomReferenceTest.java
 gc/WeakReferenceTest.java

Modified: harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
(original)
+++ harmony/enhanced/drlvm/trunk/build/make/excludes/exclude.drlvm_smoke.windows.x86_64.int
Thu May 24 08:26:45 2007
@@ -7,9 +7,6 @@
 # unknown failure
 gc/Mark.java
 
-# HARMONY-3585
-shutdown/TestFatalError.java
-
 # HARMONY-3917
 gc/PhantomReferenceTest.java
 gc/WeakReferenceTest.java

Modified: harmony/enhanced/drlvm/trunk/vm/include/interpreter_exports.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/interpreter_exports.h?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/interpreter_exports.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/interpreter_exports.h Thu May 24 08:26:45 2007
@@ -306,7 +306,7 @@
  *
  * @param file - File to dump stack to
  * @param thread - the pointer to the thread*/
-   void (*stack_dump) (FILE *, VM_thread*);
+   void (*stack_dump) (int, VM_thread*);
 
 } Interpreter;
 

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp Thu May 24 08:26:45
2007
@@ -91,7 +91,7 @@
 extern jbyte interpreter_ti_set_breakpoint(jmethodID method, jlocation location);
 extern void interpreter_ti_clear_breakpoint(jmethodID method, jlocation location, jbyte saved);
 extern jvmtiError interpreter_ti_pop_frame(jvmtiEnv*, VM_thread *thread);
-extern void stack_dump(FILE *f, VM_thread *thread);
+extern void stack_dump(int fd, VM_thread *thread);
 
 extern FrameHandle* interpreter_get_last_frame(class VM_thread *thread);
 extern FrameHandle* interpreter_get_prev_frame(FrameHandle* frame);

Modified: harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Thu May 24 08:26:45 2007
@@ -2466,6 +2466,23 @@
     stackDump(f, *frame);
 }
 
+void stack_dump(int fd, VM_thread *thread) {
+    FILE *f;
+#ifdef PLATFORM_NT
+    fd = _dup(fd);
+    assert(fd != -1);
+    f = _fdopen(fd, "w");
+#else
+    fd = dup(fd);
+    assert(fd != -1);
+    f = fdopen(fd, "w");
+#endif
+    assert(f);
+    StackFrame *frame = getLastStackFrame(thread);
+    stackDump(f, *frame);
+    fclose(f);
+}
+
 void stack_dump(VM_thread *thread) {
     StackFrame *frame = getLastStackFrame(thread);
     stackDump(stderr, *frame);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp?view=diff&rev=541322&r1=541321&r2=541322
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp Thu May 24 08:26:45 2007
@@ -265,7 +265,13 @@
     fprintf(f, "The stack trace of the %p java thread:\n", vm_thread);
 
     if (interpreter_enabled()) {
-        interpreter.stack_dump(f, vm_thread);
+        int fd;
+#ifdef PLATFORM_NT
+        fd = _fileno(f);
+#else
+        fd = fileno(f);
+#endif
+        interpreter.stack_dump(fd, vm_thread);
         fflush(f);
         return;
     }



Mime
View raw message