harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r638327 [1/5] - in /harmony/enhanced/drlvm/trunk: make/vm/ vm/em/src/ vm/gc_gen/src/common/ vm/include/open/ vm/interpreter/src/ vm/port/include/ vm/port/src/crash_handler/ vm/port/src/crash_handler/em64t/ vm/port/src/crash_handler/ia32/ vm...
Date Tue, 18 Mar 2008 11:31:10 GMT
Author: gshimansky
Date: Tue Mar 18 04:31:02 2008
New Revision: 638327

URL: http://svn.apache.org/viewvc?rev=638327&view=rev
Log:
Applied big move in platform dependent code from VM to portlib from HARMONY-5590
[drlvm][port] Move signals/exceptions handling and crash handling to the Port


Added:
    harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/include/port_modules.h
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/port/include/native_modules.h
    harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/native_unwind_arch.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/native_stack_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/reg_state.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/native_unwind_arch.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/native_stack_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/reg_state.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/stack_dump.h
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_dump.h
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/native_unwind_arch.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/reg_state.cpp
      - copied, changed from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/gdb_crash_handler.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_handler.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/gdb_crash_handler.h
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/crash_handler.h
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/native_stack_os.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/stack_dump_os.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/stack_dump_platf.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/native_unwind.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/stack_dump.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/win/
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/win/native_unwind_os.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/native_stack_os.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/win/stack_dump_os.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/stack_dump_platf.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/linux/
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/linux/memaccess.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_memory_linux.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/linux/memaccess_em64t.s
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/linux/memaccess_ia32.s
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/linux/memaccess_ipf.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/win/
    harmony/enhanced/drlvm/trunk/vm/port/src/memaccess/win/memaccess.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_memory_win.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/include/
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/include/signals_internal.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_ipf.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/port_signals.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/win/
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/win/signals_common.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/win/signals_em64t.asm
      - copied unchanged from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/exception_handlers.asm
    harmony/enhanced/drlvm/trunk/vm/port/src/signals/win/signals_ia32.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/crash_dump.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/signals.h   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/native_stack.cpp
      - copied, changed from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/crash_dump.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_dump_os.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/signals.cpp   (with props)
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/crash_dump_os.cpp   (with props)
Removed:
    harmony/enhanced/drlvm/trunk/vm/port/include/native_modules.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_mutex.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/win/os_mutex.c
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_dump.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_memory_linux.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_memory_win.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_signals_linux.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_signals_win.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/native_stack_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/native_stack_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/signals_arch.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_handler.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/crash_handler.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/exception_filter.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/native_stack_os.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/stack_dump_platf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/em64t/exception_handlers.asm
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/exception_filter.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/native_stack_os.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/stack_dump_platf.cpp
Modified:
    harmony/enhanced/drlvm/trunk/make/vm/port.xml
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h
    harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.h
    harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.h
    harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.h
    harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp
    harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.h
    harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp
    harmony/enhanced/drlvm/trunk/vm/include/open/hycomp.h
    harmony/enhanced/drlvm/trunk/vm/include/open/hycond_win.h
    harmony/enhanced/drlvm/trunk/vm/include/open/hythread_ext.h
    harmony/enhanced/drlvm/trunk/vm/include/open/platform_types.h
    harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp
    harmony/enhanced/drlvm/trunk/vm/port/include/port_crash_handler.h
    harmony/enhanced/drlvm/trunk/vm/port/include/port_frame_info.h
    harmony/enhanced/drlvm/trunk/vm/port/include/port_general.h
    harmony/enhanced/drlvm/trunk/vm/port/include/port_thread.h
    harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/port_crash_handler.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/modules/linux/native_modules_os.c
    harmony/enhanced/drlvm/trunk/vm/port/src/modules/native_modules.c
    harmony/enhanced/drlvm/trunk/vm/port/src/modules/win/native_modules_os.c
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_native_fat_monitor.c
    harmony/enhanced/drlvm/trunk/vm/tests/unit/thread/test_stress_suspend.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.def
    harmony/enhanced/drlvm/trunk/vm/thread/src/hythr.exp
    harmony/enhanced/drlvm/trunk/vm/thread/src/linux/os_condvar.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_basic.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_condvar.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_fat_monitor.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_latch.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_park.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_semaphore.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_suspend.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_native_thin_monitor.c
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_private.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/win/os_condvar.c
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/exceptions.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/finalizer_thread.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/init.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_break_intf.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/jvmti_direct.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/lock_manager.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/native_stack.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/ncai_internal.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/ref_enqueue_thread.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/C_Interface.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Verifier_stub.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/finalizer_thread.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/ref_enqueue_thread.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_properties.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_shutdown.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_capability.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/ncai_memory.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/ncai_modules.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/ncai_signals.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/ncai_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/ncai/utils/ncai_step_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/lock_manager.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_generic.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_manager.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/thread_ti_monitors.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/ia32_em64t/signals_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/platform_lowlevel.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/signals_common.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/signals_ipf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/natives_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ia32_em64t/nt_exception_filter_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/include/platform_lowlevel.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/ipf/nt_exception_filter.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/win/nt_platform_utils.cpp

Modified: harmony/enhanced/drlvm/trunk/make/vm/port.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/make/vm/port.xml?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/make/vm/port.xml (original)
+++ harmony/enhanced/drlvm/trunk/make/vm/port.xml Tue Mar 18 04:31:02 2008
@@ -29,6 +29,9 @@
             <dirset dir="${vm.home}">
                 <include name="include" />
                 <include name="port/include" />
+                <include name="port/src/signals/include" />
+                <include name="port/src/crash_handler/include" />
+                <include name="port/src/encoder/ia32_em64t" unless="is.ia64"/>
             </dirset>
             <pathelement location="${drlvm.include.dir}"/>
             <pathelement location="${hy.hdk}/include" />
@@ -75,6 +78,9 @@
                 <include name="thread/win/thread_asm_em64t.asm" if="is.windows.x86_64"/>
                 <include name="thread/linux/thread_asm_ia32.s" if="is.unix.x86"/>
                 <include name="thread/linux/thread_asm_em64t.s" if="is.unix.x86_64"/>
+                <include name="memaccess/linux/memaccess_ia32.s" if="is.unix.x86"/>
+                <include name="memaccess/linux/memaccess_em64t.s" if="is.unix.x86_64"/>
+                <include name="signals/win/signals_em64t.asm" if="is.windows.x86_64"/>
             </fileset>
         </compile-asm>
         
@@ -97,6 +103,23 @@
                     <include name="logger/**.cpp" />
                     <include name="tl/*.cpp" />
                     <include name="time/*.cpp" />
+
+                    <include name="crash_handler/*.cpp"/>
+                    <include name="crash_handler/linux/*.cpp" if="is.unix"/>
+                    <include name="crash_handler/win/*.cpp" if="is.windows"/>
+                    <include name="crash_handler/ia32/*.cpp" if="is.x86"/>
+                    <include name="crash_handler/em64t/*.cpp" if="is.x86_64"/>
+                    <include name="crash_handler/ipf/*.cpp" if="is.ia64"/>
+
+                    <include name="memaccess/win/memaccess.cpp" if="is.windows"/>
+                    <include name="memaccess/linux/memaccess.cpp" if="is.unix" unless="is.ia64"/>
+                    <include name="memaccess/linux/*ipf.cpp" if="is.unix.ia64"/>
+
+                    <include name="signals/*.cpp"/>
+                    <include name="signals/linux/*common.cpp" if="is.unix" unless="is.ia64"/>
+                    <include name="signals/linux/*ipf.cpp" if="is.unix.ia64"/>
+                    <include name="signals/win/*common.cpp" if="is.windows"/>
+                    <include name="signals/win/*ia32.cpp" if="is.windows.x86"/>
                 </fileset>
 
                 <compilerarg value="/EHsc" if="is.windows"/>
@@ -104,7 +127,11 @@
             </compiler>
         </compile-cc>
         
-        <link-lib name="port" type="static"/>
+        <link-lib name="port" type="static">
+            <linker id="linker" extends="common.linker">
+                <libset libs="encoder" dir="${drlvm.lib.dir}" />
+            </linker>
+        </link-lib>
     </target>
     
     <target name="clean" >

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.cpp Tue Mar 18 04:31:02 2008
@@ -37,6 +37,7 @@
 #include <sstream>
 #include <fstream>
 #include "port_threadunsafe.h"
+#include "port_mutex.h"
 
 #define LOG_DOMAIN "em"
 
@@ -106,13 +107,13 @@
     nMethodsCompiled=0;
     nMethodsRecompiled=0;
     tick=0;
-    hymutex_create(&recompilationLock, TM_MUTEX_NESTED);
+    port_mutex_create(&recompilationLock, APR_THREAD_MUTEX_NESTED);
     initProfileAccess();
 }
 
 DrlEMImpl::~DrlEMImpl() {
     deallocateResources();
-    hymutex_destroy(&recompilationLock);
+    port_mutex_destroy(&recompilationLock);
 }
 
 void DrlEMImpl::initProfileAccess() {
@@ -353,10 +354,6 @@
 bool DrlEMImpl::init() {
     _execute_method = JIT_execute_method_default;
 
-    if (!get_boolean_property("vm.assert_dialog", TRUE, VM_PROPERTIES)) {
-        disable_assert_dialogs();
-    }
-
     std::string config = readConfiguration();
     if (!config.empty()) {
         buildChains(config);
@@ -775,16 +772,16 @@
 
 void DrlEMImpl::methodProfileIsReady(MethodProfile* mp) {
     
-    hymutex_lock(&recompilationLock);
+    port_mutex_lock(&recompilationLock);
     if (methodsInRecompile.find((Method_Profile_Handle)mp)!=methodsInRecompile.end()) {
         //method is already recompiling by another thread or by this thread(recursion)
-        hymutex_unlock(&recompilationLock);
+        port_mutex_unlock(&recompilationLock);
         return;
     }
     
     methodsInRecompile.insert((Method_Profile_Handle)mp);
     nMethodsRecompiled++;
-    hymutex_unlock(&recompilationLock);
+    port_mutex_unlock(&recompilationLock);
 
     const char* methodName = NULL;
     const char* className = NULL;
@@ -828,9 +825,9 @@
             }
         }
     }
-    hymutex_lock(&recompilationLock);
+    port_mutex_lock(&recompilationLock);
     methodsInRecompile.erase((Method_Profile_Handle)mp);
-    hymutex_unlock(&recompilationLock);
+    port_mutex_unlock(&recompilationLock);
 }
 
 ProfileCollector* DrlEMImpl::getProfileCollector(EM_PCTYPE type, JIT_Handle jh, EM_JIT_PC_Role jitRole) const {

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/DrlEMImpl.h Tue Mar 18 04:31:02 2008
@@ -137,7 +137,7 @@
 
     uint32 tick;
     
-    hymutex_t recompilationLock;
+    osmutex_t recompilationLock;
     std::set<Method_Profile_Handle> methodsInRecompile;
 
     Method_Lookup_Table method_lookup_table;

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.cpp Tue Mar 18 04:31:02 2008
@@ -26,6 +26,7 @@
 
 #include "cxxlog.h"
 #include <sstream>
+#include "port_mutex.h"
 
 #define LOG_DOMAIN "em"
 
@@ -52,7 +53,7 @@
         INFO2(catName.c_str(), msg.str().c_str());
     }
 
-    hymutex_create(&profilesLock, TM_MUTEX_NESTED);
+    port_mutex_create(&profilesLock, APR_THREAD_MUTEX_NESTED);
 }
 
 Method_Profile_Handle eb_profiler_create_profile(PC_Handle ph, Method_Handle mh) {
@@ -112,24 +113,24 @@
         delete profile;
     }
 
-    hymutex_destroy(&profilesLock);
+    port_mutex_destroy(&profilesLock);
 }
 
 MethodProfile* EBProfileCollector::getMethodProfile(Method_Handle mh) const {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
     MethodProfile* res = NULL;
     EBProfilesMap::const_iterator it = profilesByMethod.find(mh);
     if (it != profilesByMethod.end()) {
         res = it->second;
     }
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
     return res;
 }
 
 EBMethodProfile* EBProfileCollector::createProfile(Method_Handle mh) {
     EBMethodProfile* profile = new EBMethodProfile(this, mh);
 
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
 
     assert(profilesByMethod.find(mh) == profilesByMethod.end());
     profilesByMethod[mh] = profile;
@@ -138,7 +139,7 @@
         newProfiles.push_back(profile);
     }
 
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
 
     return profile;
 }
@@ -159,10 +160,10 @@
 void EBProfileCollector::onTimeout() {
     assert(mode == EB_PCMODE_ASYNC);
     if(!newProfiles.empty()) {
-        hymutex_lock(&profilesLock);
+        port_mutex_lock(&profilesLock);
         greenProfiles.insert(greenProfiles.end(), newProfiles.begin(), newProfiles.end());
         newProfiles.clear();
-        hymutex_unlock(&profilesLock);
+        port_mutex_unlock(&profilesLock);
     }
 
     if (!unloadedMethodProfiles.empty()) {
@@ -177,10 +178,10 @@
         }
     }
     if (!tmpProfiles.empty()) {
-        hymutex_lock(&profilesLock);
+        port_mutex_lock(&profilesLock);
         std::remove(greenProfiles.begin(), greenProfiles.end(), (EBMethodProfile*)NULL);
         greenProfiles.resize(greenProfiles.size() - tmpProfiles.size());
-        hymutex_unlock(&profilesLock);
+        port_mutex_unlock(&profilesLock);
         for (EBProfiles::iterator it = tmpProfiles.begin(), end = tmpProfiles.end(); it!=end; ++it) {
             EBMethodProfile* profile = *it;
             if (loggingEnabled) {
@@ -236,7 +237,7 @@
 }
 
 void EBProfileCollector::classloaderUnloadingCallback(ClassLoaderHandle h) {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
     
     //can't modify profiles map in async mode here -> it could be iterated by the checker thread without lock
     bool erase = mode != EB_PCMODE_ASYNC;
@@ -247,5 +248,5 @@
         cleanUnloadedProfiles(false);
     }
 
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
 }

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EBProfileCollector.h Tue Mar 18 04:31:02 2008
@@ -97,7 +97,7 @@
 
     EBProfiles unloadedMethodProfiles;
 
-    mutable hymutex_t profilesLock;
+    mutable osmutex_t profilesLock;
 };
 
 class EBMethodProfile : public MethodProfile {

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.cpp Tue Mar 18 04:31:02 2008
@@ -25,6 +25,7 @@
 #include <assert.h>
 #include "cxxlog.h"
 #include <sstream>
+#include "port_mutex.h"
 
 #define LOG_DOMAIN "em"
 
@@ -95,7 +96,7 @@
                                            : ProfileCollector(em, name, EM_PCTYPE_EDGE, genJit), initialTimeout(_initialTimeout), 
                                            timeout(_timeout),eThreshold(_eThreshold), bThreshold(_bThreshold)
 {
-    hymutex_create(&profilesLock, TM_MUTEX_NESTED);
+    port_mutex_create(&profilesLock, APR_THREAD_MUTEX_NESTED);
     catName = std::string(LOG_DOMAIN) + ".profiler." + name;
     loggingEnabled =  is_info_enabled(LOG_DOMAIN) ||  is_info_enabled(catName.c_str());
     if (loggingEnabled) {
@@ -113,19 +114,19 @@
         EdgeMethodProfile* profile = it->second;
         delete profile;
     }
-    hymutex_destroy(&profilesLock);
+    port_mutex_destroy(&profilesLock);
 }
 
 
 MethodProfile* EdgeProfileCollector::getMethodProfile(Method_Handle mh) const
 {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
     MethodProfile* res = NULL;
     EdgeProfilesMap::const_iterator it = profilesByMethod.find(mh);
     if (it != profilesByMethod.end()) {
         res = it->second;    
     }
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
     return res;
 }
 
@@ -177,7 +178,7 @@
                                                         uint32* counterKeys,
                                                         uint32 checkSum)
 {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
 
     EdgeMethodProfile* profile = new EdgeMethodProfile(this, mh);
 
@@ -193,7 +194,7 @@
     profilesByMethod[mh] = profile;
     newProfiles.push_back(profile);
 
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
 
     return profile;
 }
@@ -234,10 +235,10 @@
 
 void EdgeProfileCollector::onTimeout() {
     if(!newProfiles.empty()) {
-        hymutex_lock(&profilesLock);
+        port_mutex_lock(&profilesLock);
         greenProfiles.insert(greenProfiles.end(), newProfiles.begin(), newProfiles.end());
         newProfiles.clear();
-        hymutex_unlock(&profilesLock);
+        port_mutex_unlock(&profilesLock);
     }
 
     if (!unloadedMethodProfiles.empty()) {
@@ -255,10 +256,10 @@
     }
 
     if (!tmpProfiles.empty()) {
-        hymutex_lock(&profilesLock);
+        port_mutex_lock(&profilesLock);
         std::remove(greenProfiles.begin(), greenProfiles.end(), (EdgeMethodProfile*)NULL);
         greenProfiles.resize(greenProfiles.size() - tmpProfiles.size());
-        hymutex_unlock(&profilesLock);
+        port_mutex_unlock(&profilesLock);
         for (EdgeProfiles::iterator it = tmpProfiles.begin(), end = tmpProfiles.end(); it!=end; ++it) {
             EdgeMethodProfile* profile = *it;
             if (loggingEnabled) {
@@ -298,11 +299,11 @@
 }
 
 void EdgeProfileCollector::classloaderUnloadingCallback(ClassLoaderHandle h) {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
 
     //can't modify profiles map in async mode here -> it could be iterated by the checker thread without lock
     addProfilesForClassloader(h, greenProfiles, unloadedMethodProfiles);
     addProfilesForClassloader(h, newProfiles, unloadedMethodProfiles);
 
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
 }

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/EdgeProfileCollector.h Tue Mar 18 04:31:02 2008
@@ -71,7 +71,7 @@
     EdgeProfiles newProfiles;
     EdgeProfiles tmpProfiles;
     EdgeProfiles unloadedMethodProfiles;
-    mutable hymutex_t profilesLock;
+    mutable osmutex_t profilesLock;
 };
 
 class EdgeMethodProfile : public MethodProfile {

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.cpp Tue Mar 18 04:31:02 2008
@@ -298,7 +298,7 @@
 ValueMethodProfile* ValueProfileCollector::createProfile
     (Method_Handle mh, uint32 numkeys, uint32 keys[])
 {
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
     ValueMethodProfile* profile = new ValueMethodProfile(this, mh);
     // Allocate space for value maps
     for (uint32 index = 0; index < numkeys; index++){
@@ -309,7 +309,7 @@
     }
     assert(profilesByMethod.find(mh) == profilesByMethod.end());
     profilesByMethod[mh] = profile;
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
     return profile;
 }
 
@@ -320,7 +320,7 @@
                                            : ProfileCollector(em, name, EM_PCTYPE_VALUE, genJit),
                                              updateStrategy(update_strategy)
 {
-    hymutex_create(&profilesLock, TM_MUTEX_NESTED);
+    port_mutex_create(&profilesLock, APR_THREAD_MUTEX_NESTED);
     if (_TNV_algo_type == TNV_DIVIDED) {
         tnvTableManager = new TNVTableDividedManager
             (_TNV_steady_size, _TNV_clear_size, _clear_interval, update_strategy);
@@ -346,18 +346,18 @@
         delete profile;
     }
     delete tnvTableManager;
-    hymutex_destroy(&profilesLock);
+    port_mutex_destroy(&profilesLock);
 }
 
 MethodProfile* ValueProfileCollector::getMethodProfile(Method_Handle mh) const
 {
     MethodProfile* res = NULL;
-    hymutex_lock(&profilesLock);
+    port_mutex_lock(&profilesLock);
     ValueProfilesMap::const_iterator it = profilesByMethod.find(mh);
     if (it != profilesByMethod.end()) {
         res =  it->second;
     }
-    hymutex_unlock(&profilesLock);
+    port_mutex_unlock(&profilesLock);
     return res;
 }
 //------------------------------------------------------------------------------
@@ -365,12 +365,12 @@
 ValueMethodProfile::ValueMethodProfile(ValueProfileCollector* pc, Method_Handle mh)
     : MethodProfile(pc, mh), updatingState(0)
 {
-    hymutex_create(&lock, TM_MUTEX_DEFAULT);
+    port_mutex_create(&lock, APR_THREAD_MUTEX_DEFAULT);
 }
 
 ValueMethodProfile::~ValueMethodProfile()
 {
-    hymutex_destroy(&lock);
+    port_mutex_destroy(&lock);
 }
 
 void ValueMethodProfile::addNewValue

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/NValueProfileCollector.h Tue Mar 18 04:31:02 2008
@@ -27,6 +27,7 @@
 #define _VALUE_PROFILE_COLLECTOR_H_
 
 #include "DrlProfileCollectionFramework.h"
+#include "port_mutex.h"
 #include "open/vm_util.h"
 
 #include <map>
@@ -166,7 +167,7 @@
     bool   loggingEnabled;
     typedef std::map<Method_Handle, ValueMethodProfile*> ValueProfilesMap;
     ValueProfilesMap profilesByMethod;
-    mutable hymutex_t profilesLock;
+    mutable osmutex_t profilesLock;
     TNVTableManager* tnvTableManager;
     ProfileUpdateStrategy updateStrategy;
 };
@@ -193,8 +194,8 @@
 public:
     ValueMethodProfile(ValueProfileCollector* pc, Method_Handle mh);
     ~ValueMethodProfile();
-    void lockProfile() {hymutex_lock(&lock);}
-    void unlockProfile() {hymutex_unlock(&lock);}
+    void lockProfile() {port_mutex_lock(&lock);}
+    void unlockProfile() {port_mutex_unlock(&lock);}
     void dumpValues(std::ostream& os);
     void addNewValue(uint32 instructionKey, POINTER_SIZE_INT valueToAdd);
     POINTER_SIZE_INT getResult(uint32 instructionKey);
@@ -212,7 +213,7 @@
 
     // The lock and the atomically modified updatingState flag operate per
     // method to allow simultaneous updates for distinct methods.
-    hymutex_t lock;
+    osmutex_t lock;
     uint8 updatingState;
 };
 

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.cpp Tue Mar 18 04:31:02 2008
@@ -50,7 +50,7 @@
     assert (_cache);
     memset(_cache, 0, (EIP_CACHE_SIZE * sizeof(Method_Code *)));
     reallocate(511);
-    hymutex_create(&lock, TM_MUTEX_NESTED);
+    port_mutex_create(&lock, APR_THREAD_MUTEX_NESTED);
 } //Method_Lookup_Table::Method_Lookup_Table
 
 
@@ -63,7 +63,7 @@
     if (_cache != NULL) {
         STD_FREE((void*)_cache);
     }
-    hymutex_destroy(&lock);
+    port_mutex_destroy(&lock);
 } //Method_Lookup_Table::~Method_Lookup_Table
 
 
@@ -278,7 +278,7 @@
 
 Method_Code *Method_Lookup_Table::find_deadlock_free(void *addr)
 {
-    bool ok = hymutex_trylock(&lock) == TM_ERROR_NONE;             // vvv
+    bool ok = port_mutex_trylock(&lock) == TM_ERROR_NONE;             // vvv
     if (ok) {
         // We acquired the lock.  Can use the fast lookup.
         Method_Code *m = find(addr, FALSE);

Modified: harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/em/src/method_lookup.h Tue Mar 18 04:31:02 2008
@@ -25,6 +25,7 @@
 
 #include "open/em.h"
 #include "open/hythread_ext.h"
+#include "port_mutex.h"
 
 class Method_Lookup_Table;
 
@@ -82,13 +83,13 @@
 #endif
     void table_lock()
     {
-        UNREF UDATA r = hymutex_lock(&lock);
+        UNREF UDATA r = port_mutex_lock(&lock);
         assert(TM_ERROR_NONE == r);
     }
 
     void table_unlock()
     {
-        UNREF UDATA r = hymutex_unlock(&lock);
+        UNREF UDATA r = port_mutex_unlock(&lock);
         assert(TM_ERROR_NONE == r);
     }
 
@@ -108,7 +109,7 @@
     unsigned        _next_free_entry;
     Method_Code **_table;
     Method_Code **_cache;
-    hymutex_t lock;
+    osmutex_t lock;
 }; //class Method_Lookup_Table
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/gc_gen/src/common/gc_options.cpp Tue Mar 18 04:31:02 2008
@@ -165,8 +165,6 @@
 GC* gc_parse_options() 
 {
   TRACE2("gc.process", "GC: parse options ...\n");
-  if (!get_boolean_property("vm.assert_dialog", TRUE, VM_PROPERTIES))
-    disable_assert_dialogs();
 
   GC* gc;
   

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/hycomp.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/hycomp.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/hycomp.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/hycomp.h Tue Mar 18 04:31:02 2008
@@ -190,12 +190,6 @@
 
 #endif
 
-#if !defined(FALSE)
-#define FALSE   ((BOOLEAN) 0)
-#if !defined(TRUE)
-#define TRUE    ((BOOLEAN) (!FALSE))
-#endif
-#endif
 
 #if !defined(NULL)
 #if defined(__cplusplus)

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/hycond_win.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/hycond_win.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/hycond_win.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/hycond_win.h Tue Mar 18 04:31:02 2008
@@ -46,7 +46,7 @@
 struct HyCond {
     // Synchronization is necessary because signal() caller is not required
     // to hold mutex associated with the condition variable.
-    hymutex_t queue_mutex;
+    osmutex_t queue_mutex;
     // head-tail marker node
     struct waiting_node dummy_node;
 };

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/hythread_ext.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/hythread_ext.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/hythread_ext.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/hythread_ext.h Tue Mar 18 04:31:02 2008
@@ -143,12 +143,12 @@
 
 #if defined(LINUX) || defined(FREEBSD)
 #include <pthread.h>
-#define hymutex_t pthread_mutex_t
+#define osmutex_t pthread_mutex_t
 #define hycond_t pthread_cond_t
 #endif // LINUX || FREEBSD
 
 #ifdef _WIN32
-#define hymutex_t CRITICAL_SECTION
+#define osmutex_t CRITICAL_SECTION
 #define hycond_t struct HyCond
 #include "hycond_win.h"
 #endif // _WIN32
@@ -308,7 +308,7 @@
     /**
      * Thread local lock, used to serialize thread state;
      */
-    hymutex_t mutex;
+    osmutex_t mutex;
 
     /**
      * Monitor used to implement wait function for sleep/park;
@@ -473,10 +473,10 @@
 //@{
 
 IDATA VMCALL hycond_create (hycond_t *cond);
-IDATA VMCALL hycond_wait (hycond_t *cond, hymutex_t *mutex);
-IDATA VMCALL hycond_wait_timed (hycond_t *cond, hymutex_t *mutex, I_64 millis, IDATA nanos);
-IDATA VMCALL hycond_wait_timed_raw(hycond_t * cond, hymutex_t * mutex, I_64 ms, IDATA nano);
-IDATA VMCALL hycond_wait_interruptable (hycond_t *cond, hymutex_t *mutex, I_64 millis, IDATA nanos);
+IDATA VMCALL hycond_wait (hycond_t *cond, osmutex_t *mutex);
+IDATA VMCALL hycond_wait_timed (hycond_t *cond, osmutex_t *mutex, I_64 millis, IDATA nanos);
+IDATA VMCALL hycond_wait_timed_raw(hycond_t * cond, osmutex_t * mutex, I_64 ms, IDATA nano);
+IDATA VMCALL hycond_wait_interruptable (hycond_t *cond, osmutex_t *mutex, I_64 millis, IDATA nanos);
 IDATA VMCALL hycond_notify (hycond_t *cond);
 IDATA VMCALL hycond_notify_all (hycond_t *cond);
 IDATA VMCALL hycond_destroy (hycond_t *cond);
@@ -537,17 +537,6 @@
 IDATA hysem_set(hysem_t sem, IDATA count);
 
 //@}
-/** @name Mutex
- */
-//@{
-
-IDATA hymutex_create (hymutex_t *mutex, UDATA flags);
-IDATA hymutex_lock(hymutex_t *mutex);
-IDATA hymutex_trylock (hymutex_t *mutex);
-IDATA hymutex_unlock (hymutex_t *mutex);
-IDATA hymutex_destroy (hymutex_t *mutex);
-
-//@}
 /** @name Thin monitors support
  */
 //@{
@@ -706,10 +695,6 @@
 // 0x00400000   Thread is in native code. That is a native method is running which
 //              has not called back into the VM or Java programming language code.
 #define TM_THREAD_STATE_IN_NATIVE                JVMTI_THREAD_STATE_IN_NATIVE
-
-#define TM_MUTEX_DEFAULT  0   
-#define TM_MUTEX_NESTED   1  
-#define TM_MUTEX_UNNESTED 2 
 
 #define WAIT_INTERRUPTABLE    1
 #define WAIT_NONINTERRUPTABLE 0

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/platform_types.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/platform_types.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/platform_types.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/platform_types.h Tue Mar 18 04:31:02 2008
@@ -62,6 +62,7 @@
 #ifndef FALSE
 #define FALSE 0
 #endif
+
 typedef unsigned Boolean;
 
 typedef unsigned char    Byte;

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?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/interpreter/src/interp_exports.cpp Tue Mar 18 04:31:02 2008
@@ -122,13 +122,6 @@
     interpreter->interpreter_ti_notify_frame_pop = &interpreter_ti_notify_frame_pop;
     interpreter->interpreter_ti_pop_frame = &interpreter_ti_pop_frame;
     interpreter->stack_dump = &stack_dump;
-
-#if defined (PLATFORM_NT) && defined (_DEBUG)
-    if (!get_boolean_property("vm.assert_dialog", TRUE, VM_PROPERTIES))
-    {
-        disable_assert_dialogs();
-    }
-#endif
 }
 
 EXPORT Boolean JIT_supports_compressed_references(JIT_Handle UNREF jh) {

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/port_crash_handler.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_crash_handler.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_crash_handler.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_crash_handler.h Tue Mar 18 04:31:02 2008
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-#ifdef _PORT_CRASH_HANDLER_
+#ifndef _PORT_CRASH_HANDLER_
 #define _PORT_CRASH_HANDLER_
 
 
@@ -27,7 +27,7 @@
 #include "port_frame_info.h"
 
 #ifdef __cplusplus
-extern "C"
+extern "C" {
 #endif
 
 /**
@@ -38,7 +38,7 @@
     /**
      * General protection fault, e.g. SIGSEGV on unix.
      */
-    PORT_SIGNAL_GPF,
+    PORT_SIGNAL_GPF = 0,
     /**
      * Special type of GPF when crash happens because of stack
      * overflow. It can be handled on the same stack because guard
@@ -50,20 +50,31 @@
      */
     PORT_SIGNAL_ABORT,
     /**
-     * Process executed a trap, e.g. INT3 on x86.
+     * Ctrl-\ combination was pressed.
      */
-    PORT_SIGNAL_TRAP,
+    PORT_SIGNAL_QUIT,
     /**
-     * Process executed a privileged instruction (only on Windows),
-     * e.g. CLI.
+     * Ctrl-Break combination was pressed.
      */
-    PORT_SIGNAL_PRIV_INSTR,
+    PORT_SIGNAL_CTRL_BREAK,
+    /**
+     * Ctrl-C combination was pressed.
+     */
+    PORT_SIGNAL_CTRL_C,
+    /**
+     * Process met a breakpoint set with port_set_breakpoint().
+     */
+    PORT_SIGNAL_BREAKPOINT,
     /**
      * Process encountered an arithmeric error, e.g. division by
      * zero.
      */
     PORT_SIGNAL_ARITHMETIC,
     /**
+     * Unknown signal - does not have a handler.
+     */
+    PORT_SIGNAL_UNKNOWN,
+    /**
      * Maximum identifier for signal type
      */
     PORT_SIGNAL_MIN = PORT_SIGNAL_GPF,
@@ -83,13 +94,15 @@
  * @param signum - signal that in the thread.
  * @param regs - platform dependent register context of the process at
  * signal point.
+ * @param fault_addr - fault address.
  * @return <code>TRUE</code> if signal is handled by the process and
  * execution should continue. <code>FALSE</code> if signal is not handled
  * by the process and crash handler should execute crash sequence.
  */
-typedef Boolean (port_signal_handler *)(
+typedef Boolean (*port_signal_handler)(
     port_sigtype signum,
-    Registers *regs);
+    Registers *regs,
+    void* fault_addr);
 
 /**
  * Signal callback registration information.
@@ -124,7 +137,7 @@
  */
 Boolean port_init_crash_handler(
     port_signal_handler_registration *registrations,
-    unsigned count
+    unsigned count,
     port_unwind_compiled_frame unwind_callback);
 
 /**
@@ -178,19 +191,28 @@
     /**
      * Crash handler should create a core/mini dump of program state.
      */
-    PORT_CRASH_DUMP_PROCESS_CORE = 0x400
+    PORT_CRASH_DUMP_PROCESS_CORE = 0x0400
 } port_crash_handler_flags;
 
 /**
+ * Returns supported features from the list of crash handler flags.
+ * When unsupported feature is requested, port_crash_handler_set_flags
+ * does not fail.
+ *
+ * @returns  supported crash handler features.
+ */
+unsigned port_crash_handler_get_capabilities();
+
+/**
  * Set crash handler output flags. Default mode is <code>
  * PORT_CRASH_DUMP_TO_STDERR |
  * PORT_CRASH_STACK_DUMP | PORT_CRASH_PRINT_COMMAND_LINE |
  * PORT_CRASH_PRINT_ENVIRONMENT | PORT_CRASH_PRINT_MODULES |
- * PORT_CRASH_PRINT_REGISTERS | PORT_CRASH_PRINT_THREADS_LIST</code>.
+ * PORT_CRASH_PRINT_REGISTERS</code>.
  *
  * @param flags - crash handler output flags.
  */
-void port_crash_handler_set_flags(port_crash_handler_flags flags);
+void port_crash_handler_set_flags(unsigned flags);
 
 /**
  * Callback function that is called at the end of shutdown sequence.
@@ -201,8 +223,12 @@
  * @param signum - signal that in the thread.
  * @param regs - platform dependent register context of the process at
  * signal point.
+ * @param fault_addr - fault address.
  */
-typedef void (port_crash_handler_action *)(port_sigtype signum, Registers *regs);
+typedef void (*port_crash_handler_action)(
+    port_sigtype signum,
+    Registers *regs,
+    void* fault_addr);
 
 /**
  * Add an action to be done at the end of crash sequence. Actions may
@@ -231,8 +257,39 @@
  */
 Boolean port_shutdown_crash_handler();
 
+
+/**
+* Instruments specified location to produce PORT_SIGNAL_BREAKPOINT event.
+* @param [in] addr  - memory location to instrument.
+* @param [out] prev - address to store previous value of the instrumented byte.
+* @return <code>0</code> if OK; nonzero if the location is already
+* instrumented or if an error occured.
+* @note Caller should keep store previous byte to restore
+* the location in future.
+*/
+int port_set_breakpoint(void* addr, unsigned char* prev);
+
+/**
+* Restores original byte in the location previously instrumented
+* with port_set_breakpoint.
+* @param [in] addr  - memory location to deinstrument.
+* @param [in] prev  - previous byte to restore.
+* @return <code>0</code> if OK; nonzero if the location was not
+* instrumented yet or if an error occured.
+*/
+int port_clear_breakpoint(void* addr, unsigned char prev);
+
+/**
+* Checks if the location is instrumented.
+* @param [in] addr  - memory location to deinstrument.
+* @return <code>TRUE</code> if instrumented; FALSE otherwise.
+*/
+Boolean port_is_breakpoint_set(void* addr);
+
+
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif // _PORT_CRASH_HANDLER_
+#endif /* _PORT_CRASH_HANDLER_ */

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/port_frame_info.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_frame_info.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_frame_info.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_frame_info.h Tue Mar 18 04:31:02 2008
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-#ifdef _PORT_FRAME_INFO_
+#ifndef _PORT_FRAME_INFO_
 #define _PORT_FRAME_INFO_
 
 #include "open/platform_types.h"
@@ -32,19 +32,19 @@
     /**
      * Method class name executed at specified stack frame
      */
-    char *method_class_name;
+    const char *method_class_name;
     /**
      * Method name executed at specified stack frame
      */
-    char *method_name;
+    const char *method_name;
     /**
      * Method signature executed at specified stack frame
      */
-    char *method_signature;
+    const char *method_signature;
     /**
      * Method source file executed at specified stack frame
      */
-    char *source_file_name;
+    const char *source_file_name;
     /**
      * Source line number
      */
@@ -75,8 +75,8 @@
  * allocated in frame_info->iteration_state. Zero if unwinding is
  * successful and -1 if unwinding is not successful.
  */
-typedef int (port_unwind_compiled_frame *)(Registers *regs,
+typedef int (*port_unwind_compiled_frame)(Registers *regs,
     port_stack_frame_info *frame_info);
 
-#endif // _PORT_FRAME_INFO_
+#endif /* _PORT_FRAME_INFO_ */
 

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/port_general.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_general.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_general.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_general.h Tue Mar 18 04:31:02 2008
@@ -23,6 +23,7 @@
 #define _PORT_GENERAL_H_
 
 #include <apr.h>
+#include <stdlib.h>
 
 #ifndef NULL
 #ifdef __cplusplus
@@ -32,24 +33,30 @@
 #endif /* __cplusplus */
 #endif /* NULL */
 
+#ifdef WIN32
+#define PORT_PATH_MAX _MAX_PATH
+#else /* !WIN32 */
+#define PORT_PATH_MAX PATH_MAX
+#endif
+
 
 #ifdef __cplusplus
 #define PORT_INLINE inline
-#else // !__cplusplus
+#else /* !__cplusplus */
 
 #ifdef WIN32
 #define PORT_INLINE __forceinline
-#else // !WIN32
+#else /* !WIN32 */
 
 #ifdef __linux__
 #define PORT_INLINE static  __attribute__((always_inline))
-#else // !__linux__
+#else /* !__linux__ */
 #define PORT_INLINE static
-#endif // __linux__
+#endif /* __linux__ */
 
-#endif // WIN32
+#endif /* WIN32 */
 
-#endif // __cplusplus
+#endif /* __cplusplus */
 
 
 #endif /* _PORT_GENERAL_H_ */

Added: harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h?rev=638327&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h Tue Mar 18 04:31:02 2008
@@ -0,0 +1,53 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef _PORT_MEMACCESS_H_
+#define _PORT_MEMACCESS_H_
+
+#include <stddef.h>
+#include "open/platform_types.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+* Tries to read specified number of bytes from given address into buffer.
+* @param addr   - memory address to read.
+* @param size   - size of bytes to read.
+* @param buf    - buffer to read to.
+* @return <code>0</code> if OK; nonzero if an error occured.
+*/
+int port_read_memory(void* addr, size_t size, void* buf);
+
+/**
+* Tries to write specified number of bytes from buffer to given address.
+* @param addr   - memory address to write.
+* @param size   - size of bytes to write.
+* @param buf    - buffer to write from.
+* @return <code>0</code> if OK; nonzero if an error occured.
+*/
+int port_write_memory(void* addr, size_t size, void* buf);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _PORT_MEMACCESS_H_ */

Propchange: harmony/enhanced/drlvm/trunk/vm/port/include/port_memaccess.h
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: harmony/enhanced/drlvm/trunk/vm/port/include/port_modules.h (from r637845, harmony/enhanced/drlvm/trunk/vm/port/include/native_modules.h)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_modules.h?p2=harmony/enhanced/drlvm/trunk/vm/port/include/port_modules.h&p1=harmony/enhanced/drlvm/trunk/vm/port/include/native_modules.h&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/native_modules.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_modules.h Tue Mar 18 04:31:02 2008
@@ -19,12 +19,12 @@
  * @version $Revision: 1.1.2.1 $
  */
 
-#ifndef _NATIVE_MODULES_H_
-#define _NATIVE_MODULES_H_
+#ifndef _PORT_MODULES_H_
+#define _PORT_MODULES_H_
 
 #include <stddef.h>
 #include <stdio.h>
-#include "open/types.h"
+#include "open/platform_types.h"
 
 
 typedef enum {
@@ -89,4 +89,4 @@
 }
 #endif
 
-#endif // _NATIVE_MODULES_H_
+#endif // _PORT_MODULES_H_

Added: harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h?rev=638327&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h Tue Mar 18 04:31:02 2008
@@ -0,0 +1,157 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef _PORT_MUTEX_H_
+#define _PORT_MUTEX_H_
+
+/**
+ * @file port_mutex.h
+ * @brief PORT mutex support
+ */
+
+/* error codes */
+#include "apr_errno.h"
+/* mutex flags */
+#include "apr_thread_mutex.h"
+/* osmutex_t type */
+#include "open/hythread_ext.h"
+
+#include "port_general.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @defgroup port_mutex Basic mutexes
+ * @ingroup port_apr
+ * @{
+ */
+
+/**
+ * Initializes a mutex.
+ *
+ * A memory for mutex must be preallocated.
+ *
+ * @param[in] mutex the address of the mutex to be initialized
+ * @param[in] flags Or'ed value of:
+ * <PRE>
+ *           APR_THREAD_MUTEX_DEFAULT   platform-optimal lock behavior.
+ *           APR_THREAD_MUTEX_NESTED    enable nested (recursive) locks.
+ *           APR_THREAD_MUTEX_UNNESTED  disable nested locks (non-recursive).
+ * </PRE>
+ */
+PORT_INLINE apr_status_t port_mutex_create(osmutex_t *mutex, UDATA flags) {
+#if defined(WIN32)
+    int r = 0;
+    if (flags & APR_THREAD_MUTEX_UNNESTED) {
+        assert(!"not implemented");
+        return -1;
+    }
+    InitializeCriticalSection(mutex);
+    return r;
+#else /* PTHREADS */
+    int r = 0;
+    if (flags & APR_THREAD_MUTEX_NESTED) {
+        pthread_mutexattr_t attr;
+        pthread_mutexattr_init(&attr);
+        r = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+        if (r) return r;
+        r = pthread_mutex_init(mutex, &attr);
+        pthread_mutexattr_destroy(&attr);
+    } else {
+        r = pthread_mutex_init(mutex, NULL);
+    }
+    return r;
+#endif
+}
+
+/**
+ * Acquires the lock for the given mutex. If the mutex is already locked,
+ * the current thread will be put to sleep until the lock becomes available.
+ *
+ * @param[in] mutex the mutex on which to acquire the lock.
+ * @sa apr_thread_mutex_lock()
+ */
+PORT_INLINE apr_status_t port_mutex_lock(osmutex_t *mutex) {
+#if defined(WIN32)
+    EnterCriticalSection(mutex);
+    return 0;
+#else /* PTHREADS */
+    return pthread_mutex_lock(mutex);
+#endif
+}
+
+/**
+ * Attempts to acquire the lock for the given mutex.
+ *
+ * @param[in] mutex the mutex on which to attempt the lock acquiring.
+ * @sa apr_thread_mutex_trylock()
+ */
+PORT_INLINE apr_status_t port_mutex_trylock(osmutex_t *mutex) {
+#if defined(WIN32)
+    int r;
+    r = TryEnterCriticalSection(mutex);
+    // Return code is non-zero on success
+    if (r == 0) return TM_ERROR_EBUSY;
+    return 0;
+#else /* PTHREADS */
+    int r;
+    r = pthread_mutex_trylock(mutex);
+    if (r == EBUSY) return TM_ERROR_EBUSY;
+    return r;
+#endif
+}
+
+/**
+ * Releases the lock for the given mutex.
+ *
+ * @param[in] mutex the mutex from which to release the lock.
+ * @sa apr_thread_mutex_unlock()
+ */
+PORT_INLINE apr_status_t port_mutex_unlock(osmutex_t *mutex) {
+#if defined(WIN32)
+    LeaveCriticalSection(mutex);
+    return 0;
+#else /* PTHREADS */
+    return pthread_mutex_unlock(mutex);
+#endif
+}
+
+/**
+ * Destroys the mutex.
+ *
+ * @param[in] mutex the mutex to destroy.
+ * @sa apr_thread_mutex_destroy()
+ */
+PORT_INLINE apr_status_t port_mutex_destroy(osmutex_t *mutex) {
+#if defined(WIN32)
+    DeleteCriticalSection(mutex);
+    return 0;
+#else /* PTHREADS */
+    return pthread_mutex_destroy(mutex);
+#endif
+}
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* _PORT_MUTEX_H_ */

Propchange: harmony/enhanced/drlvm/trunk/vm/port/include/port_mutex.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: harmony/enhanced/drlvm/trunk/vm/port/include/port_thread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_thread.h?rev=638327&r1=638326&r2=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_thread.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_thread.h Tue Mar 18 04:31:02 2008
@@ -23,9 +23,10 @@
  * @brief PORT thread support
  */
 
-/* For osthread_t and thread_context_t types */
+/* osthread_t and thread_context_t types, and proper windows.h inclusion */
 #include "open/hythread_ext.h"
 
+#include "port_general.h"
 
 /* Thread context definition for UNIX-like systems */
 #if defined(LINUX) || defined(FREEBSD) 
@@ -61,9 +62,18 @@
  */
 //@{
 
+PORT_INLINE int port_gettid()
+{
+#ifdef PLATFORM_POSIX
+    return gettid();
+#else
+    return (int)GetCurrentThreadId();
+#endif
+}
 
 void port_thread_yield_other(osthread_t thread);
 int port_thread_cancel(osthread_t os_thread);
+
 
 int port_thread_suspend(osthread_t thread);
 int port_thread_resume(osthread_t thread);

Added: harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h?rev=638327&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h Tue Mar 18 04:31:02 2008
@@ -0,0 +1,44 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef __PORT_UNWIND_H__
+#define __PORT_UNWIND_H__
+
+#include "port_modules.h"
+
+typedef struct UnwindContext {
+    native_module_t*    modules;
+    bool                clean_modules;
+    native_segment_t    stack;
+} UnwindContext;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+bool port_init_unwind_context(UnwindContext* context, native_module_t* modules, Registers* regs);
+void port_clean_unwind_context(UnwindContext* context);
+
+bool port_unwind_frame(UnwindContext* context, Registers* regs);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __PORT_UNWIND_H__

Propchange: harmony/enhanced/drlvm/trunk/vm/port/include/port_unwind.h
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/native_unwind_arch.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/native_stack_em64t.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/native_unwind_arch.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/native_unwind_arch.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/native_stack_em64t.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/native_stack_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/native_unwind_arch.cpp Tue Mar 18 04:31:02 2008
@@ -20,11 +20,11 @@
  */
 
 #include "dec_base.h"
-#include "native_modules.h"
-#include "native_stack.h"
+#include "port_modules.h"
+#include "native_unwind.h"
 
 
-bool native_is_frame_exists(WalkContext* context, Registers* regs)
+bool native_is_frame_exists(UnwindContext* context, Registers* regs)
 {
     // Check for frame layout and stack values
     if ((regs->rbp < regs->rsp) || !native_is_in_stack(context, (void*)regs->rbp))
@@ -34,10 +34,10 @@
     void* rip = frame_ptr[1]; // Return address
 
     // Check return address for meaning
-    return (native_is_in_code(context, rip) || native_is_ip_stub(rip));
+    return (native_is_in_code(context, rip));
 }
 
-bool native_unwind_stack_frame(WalkContext* context, Registers* regs)
+bool native_unwind_stack_frame(UnwindContext* context, Registers* regs)
 {
     void** frame = (void**)regs->rbp;
 
@@ -48,7 +48,7 @@
 
 
     if (native_is_in_stack(context, rsp) &&
-        (native_is_in_code(context, rip) || native_is_ip_stub(rip)))
+        (native_is_in_code(context, rip)))
     {
         regs->rbp = (uint64)rbp;
         regs->rsp = (uint64)rsp;
@@ -59,14 +59,7 @@
     return false;
 }
 
-void native_get_regs_from_jit_context(JitFrameContext* jfc, Registers* regs)
-{
-    regs->rip = *jfc->p_rip;
-    regs->rbp = *jfc->p_rbp;
-    regs->rsp = jfc->rsp;
-}
-
-static bool fill_regs_from_sp(WalkContext* context, Registers* regs, void** sp)
+static bool fill_regs_from_sp(UnwindContext* context, Registers* regs, void** sp)
 {
     regs->rsp = (uint64)(sp + 1);
     regs->rip = (uint64)*sp;
@@ -74,7 +67,7 @@
     return true;
 }
 
-static unsigned native_dec_instr(WalkContext* context, void* addr, void** target)
+static unsigned native_dec_instr(UnwindContext* context, void* addr, void** target)
 {
     Inst inst;
 
@@ -94,7 +87,7 @@
     return len;
 }
 
-static bool native_check_caller(WalkContext* context, Registers* regs, void** sp)
+static bool native_check_caller(UnwindContext* context, Registers* regs, void** sp)
 {
     void* target = NULL;
     char* ptr = (char*)*sp;
@@ -126,7 +119,7 @@
 #define MAX_SPECIAL_DEPTH 0x900
 #define NATIVE_STRICT_UNWINDING 1
 
-bool native_unwind_special(WalkContext* context, Registers* regs)
+bool native_unwind_special(UnwindContext* context, Registers* regs)
 {
     for (void** cur_sp = (void**)regs->rsp;
          (char*)cur_sp < ((char*)regs->rsp + MAX_SPECIAL_DEPTH) && native_is_in_stack(context, cur_sp);
@@ -144,16 +137,4 @@
     }
 
     return false;
-}
-
-void native_fill_frame_info(Registers* regs, native_frame_t* frame, jint jdepth)
-{
-    frame->java_depth = jdepth;
-
-    if (!regs)
-        return;
-
-    frame->ip = (void*)regs->rip;
-    frame->frame = (void*)regs->rbp;
-    frame->stack = (void*)regs->rsp;
 }

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/reg_state.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/signals_arch.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/reg_state.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/reg_state.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/signals_arch.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/signals_arch.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/em64t/reg_state.cpp Tue Mar 18 04:31:02 2008
@@ -16,7 +16,9 @@
  */
 
 #include <stdio.h>
-#include "vm_core_types.h"
+#include "open/platform_types.h"
+#include "stack_dump.h"
+
 
 void print_reg_state(Registers* regs)
 {

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/native_unwind_arch.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/native_stack_ia32.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/native_unwind_arch.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/native_unwind_arch.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/native_stack_ia32.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/native_stack_ia32.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/native_unwind_arch.cpp Tue Mar 18 04:31:02 2008
@@ -20,11 +20,11 @@
  */
 
 #include "dec_base.h"
-#include "native_modules.h"
-#include "native_stack.h"
+#include "port_modules.h"
+#include "native_unwind.h"
 
 
-bool native_is_frame_exists(WalkContext* context, Registers* regs)
+bool native_is_frame_exists(UnwindContext* context, Registers* regs)
 {
     // Check for frame layout and stack values
     if ((regs->ebp < regs->esp) || !native_is_in_stack(context, (void*)regs->ebp))
@@ -34,10 +34,10 @@
     void* eip = frame_ptr[1]; // Return address
 
     // Check return address for meaning
-    return (native_is_in_code(context, eip) || native_is_ip_stub(eip));
+    return (native_is_in_code(context, eip));
 }
 
-bool native_unwind_stack_frame(WalkContext* context, Registers* regs)
+bool native_unwind_stack_frame(UnwindContext* context, Registers* regs)
 {
     void** frame = (void**)regs->ebp;
 
@@ -48,7 +48,7 @@
 
 
     if (native_is_in_stack(context, esp) &&
-        (native_is_in_code(context, eip) || native_is_ip_stub(eip)))
+        (native_is_in_code(context, eip)))
     {
         regs->ebp = (uint32)ebp;
         regs->esp = (uint32)esp;
@@ -59,14 +59,7 @@
     return false;
 }
 
-void native_get_regs_from_jit_context(JitFrameContext* jfc, Registers* regs)
-{
-    regs->eip = *jfc->p_eip;
-    regs->ebp = *jfc->p_ebp;
-    regs->esp = jfc->esp;
-}
-
-static bool fill_regs_from_sp(WalkContext* context, Registers* regs, void** sp)
+static bool fill_regs_from_sp(UnwindContext* context, Registers* regs, void** sp)
 {
     regs->esp = (uint32)(sp + 1);
     regs->eip = (uint32)*sp;
@@ -74,7 +67,7 @@
     return true;
 }
 
-static unsigned native_dec_instr(WalkContext* context, void* addr, void** target)
+static unsigned native_dec_instr(UnwindContext* context, void* addr, void** target)
 {
     Inst inst;
 
@@ -94,7 +87,7 @@
     return len;
 }
 
-static bool native_check_caller(WalkContext* context, Registers* regs, void** sp)
+static bool native_check_caller(UnwindContext* context, Registers* regs, void** sp)
 {
     void* target = NULL;
     char* ptr = (char*)*sp;
@@ -126,7 +119,7 @@
 #define MAX_SPECIAL_DEPTH 0x400
 #define NATIVE_STRICT_UNWINDING 1
 
-bool native_unwind_special(WalkContext* context, Registers* regs)
+bool native_unwind_special(UnwindContext* context, Registers* regs)
 {
     for (void** cur_sp = (void**)regs->esp;
          (char*)cur_sp < ((char*)regs->esp + MAX_SPECIAL_DEPTH) && native_is_in_stack(context, cur_sp);
@@ -144,16 +137,4 @@
     }
 
     return false;
-}
-
-void native_fill_frame_info(Registers* regs, native_frame_t* frame, jint jdepth)
-{
-    frame->java_depth = jdepth;
-
-    if (!regs)
-        return;
-
-    frame->ip = (void*)regs->eip;
-    frame->frame = (void*)regs->ebp;
-    frame->stack = (void*)regs->esp;
 }

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/reg_state.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/signals_arch.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/reg_state.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/reg_state.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/signals_arch.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/signals_arch.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ia32/reg_state.cpp Tue Mar 18 04:31:02 2008
@@ -16,7 +16,9 @@
  */
 
 #include <stdio.h>
-#include "vm_core_types.h"
+#include "open/platform_types.h"
+#include "stack_dump.h"
+
 
 void print_reg_state(Registers* regs)
 {

Added: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h?rev=638327&view=auto
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h (added)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h Tue Mar 18 04:31:02 2008
@@ -0,0 +1,45 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+
+#ifndef __NATIVE_UNWIND_H__
+#define __NATIVE_UNWIND_H__
+
+#include "port_modules.h"
+#include "port_unwind.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// Interchange between platform-dependent and general functions
+
+bool native_unwind_stack_frame(UnwindContext* context, Registers* regs);
+bool native_get_stack_range(UnwindContext* context, Registers* regs, native_segment_t* seg);
+bool native_is_frame_exists(UnwindContext* context, Registers* regs);
+bool native_unwind_special(UnwindContext* context, Registers* regs);
+bool native_is_in_code(UnwindContext* context, void* ip);
+bool native_is_in_stack(UnwindContext* context, void* sp);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__NATIVE_UNWIND_H__ */

Propchange: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/native_unwind.h
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/stack_dump.h (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_dump.h)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/stack_dump.h?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/stack_dump.h&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_dump.h&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/stack_dump.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/include/stack_dump.h Tue Mar 18 04:31:02 2008
@@ -14,72 +14,59 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-/** 
- * @author Vladimir Nenashev
- * @version $Revision$
- */  
 
 
-#ifndef __STACK_DUMP_H_
-#define __STACK_DUMP_H_
+#ifndef __STACK_DUMP_H__
+#define __STACK_DUMP_H__
 
-#include "open/hythread_ext.h"
-#include "vm_core_types.h"
-#include "jni.h"
-#include "native_modules.h"
+#include "open/platform_types.h"
+#include "port_general.h"
+#include "port_modules.h"
+#include "port_crash_handler.h"
 
 
-#ifdef _DEBUG
-#define SD_UPDATE_MODULES
-#endif
-
-#ifdef SD_UPDATE_MODULES
-#define sd_update_modules() sd_update_modules()
-#else
-#define sd_update_modules()
-#endif
-
-#ifdef PLATFORM_POSIX
-#include <strings.h>
-#define strcmp_case strcasecmp
-#else // Win
-#include <string.h>
-#define strcmp_case _stricmp
-#endif
-
-#include "platform_lowlevel.h"
-
 #define SD_MNAME_LENGTH 2048
 
-// Symbolic method info: method name, source file name and a line number of an instruction within the method
-struct MethodInfo {
-    char method_name[SD_MNAME_LENGTH];
-    char file_name[_MAX_PATH];
-    int line;
-};
-
-
 /**
- * Prints a stack trace using given register context for current thread
+ * Symbolic method info:
+ * method name, source file name and a line number of an instruction
+ * within the method
  */
-void sd_print_stack(Registers* regs);
+struct CFunInfo {
+    char name[SD_MNAME_LENGTH];
+    char filename[PORT_PATH_MAX];
+    int line;
+};
 
-/**
- * Updates modules list for crash reporting
- */
-#ifdef SD_UPDATE_MODULES
-void sd_update_modules();
+#ifdef __cplusplus
+extern "C" {
 #endif
 
-// platform-dependent functions
-bool sd_initialize(hymutex_t** p_lock);
-void sd_parse_module_info(native_module_t* module, void* ip);
-void sd_get_c_method_info(MethodInfo* info, native_module_t* module, void* ip);
-int sd_get_cur_tid();
 void sd_init_crash_handler();
-void sd_print_cwdcmdenv();
+void sd_cleanup_crash_handler();
+void sd_get_c_method_info(CFunInfo* info, native_module_t* module, void* ip);
+void sd_print_cmdline_cwd();
+void sd_print_environment();
+
+unsigned port_crash_handler_get_flags();
+int initialize_signals();
+int shutdown_signals();
+
+void sd_print_crash_info(int signum, Registers* regs, port_unwind_compiled_frame unwind);
+
+void print_reg_state(Registers* regs);
+
+/* Returns 0  when execution should be continued with (updated) Registers
+   Returns 1  when crash occured and process should invoke a debugger
+   Returns -1 when crash occured and process should be terminated */
+int port_process_signal(port_sigtype signum, Registers *regs, void* fault_addr, Boolean iscrash);
+
+#ifdef WIN32
+void create_minidump(LPEXCEPTION_POINTERS exp);
+#endif
 
-// general functions to call from platform-dependent code
-const char* sd_get_module_type(const char* short_name);
+#ifdef __cplusplus
+}
+#endif
 
-#endif //!__STACK_DUMP_H_
+#endif /* !__STACK_DUMP_H__ */

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/native_unwind_arch.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/native_unwind_arch.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/native_unwind_arch.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/native_stack_ipf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/native_unwind_arch.cpp Tue Mar 18 04:31:02 2008
@@ -19,28 +19,20 @@
  * @version $Revision: 1.1.2.1 $
  */
 
-#include "native_stack.h"
+#include "native_unwind.h"
 
 
-bool native_is_frame_exists(WalkContext* UNREF context, Registers* UNREF regs)
+bool native_is_frame_exists(UnwindContext* UNREF context, Registers* UNREF regs)
 {
     return false;
 }
 
-bool native_unwind_stack_frame(WalkContext* UNREF context, Registers* UNREF regs)
+bool native_unwind_stack_frame(UnwindContext* UNREF context, Registers* UNREF regs)
 {
     return false;
 }
 
-void native_get_regs_from_jit_context(JitFrameContext* UNREF jfc, Registers* UNREF regs)
-{
-}
-
-bool native_unwind_special(WalkContext* UNREF context, Registers* UNREF regs)
+bool native_unwind_special(UnwindContext* UNREF context, Registers* UNREF regs)
 {
     return false;
-}
-
-void native_fill_frame_info(Registers* UNREF regs, native_frame_t* UNREF frame, jint UNREF jdepth)
-{
 }

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/reg_state.cpp (from r637845, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/signals_arch.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/reg_state.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/reg_state.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/signals_arch.cpp&r1=637845&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ipf/base/signals_arch.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/ipf/reg_state.cpp Tue Mar 18 04:31:02 2008
@@ -16,7 +16,9 @@
  */
 
 #include <stdio.h>
-#include "vm_core_types.h"
+#include "open/platform_types.h"
+#include "stack_dump.h"
+
 
 void print_reg_state(Registers* regs)
 {

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/gdb_crash_handler.cpp (from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_handler.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/gdb_crash_handler.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/gdb_crash_handler.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_handler.cpp&r1=637971&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/crash_handler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/gdb_crash_handler.cpp Tue Mar 18 04:31:02 2008
@@ -24,19 +24,16 @@
 #include <stdio.h>
 #include <semaphore.h>
 
-#include "vm_core_types.h"
-#include "environment.h"
+#include "open/platform_types.h"
 #include "port_sysinfo.h"
-#include "platform_lowlevel.h"
-#include "exception_filter.h"
 #include "port_thread.h"
+#include "port_malloc.h"
 
-#include "crash_handler.h"
+#include "../linux/include/gdb_crash_handler.h"
 
 static char* g_executable = NULL;// Executable file name
 static sem_t g_sem_started;     // Prevent forking debugger more than once
 static bool g_prepared = false; // Flag is set if gdb crash handler is prepared
-static bool g_enabled = false;  // vm.crash_handler value is stored here
 
 
 #if defined (__INTEL_COMPILER)
@@ -45,21 +42,12 @@
 #endif
 
 
-bool is_gdb_crash_handler_enabled()
-{
-    return (g_prepared && g_enabled);
-}
-
 bool gdb_crash_handler(Registers* regs)
 {
-    if (!g_prepared || !g_enabled ||
-        !g_executable ||
+    if (!g_prepared || !g_executable ||
         0 != sem_trywait(&g_sem_started)) // gdb was already started
         return false;
 
-    // Print register info
-    print_reg_state(regs);
-
     static const int tid_len = 10;
     char tid[tid_len];
     snprintf(tid, tid_len, "%d", gettid());
@@ -94,19 +82,22 @@
 }
 
 
-void init_gdb_crash_handler()
+bool init_gdb_crash_handler()
 {
     if (sem_init(&g_sem_started, 0, 1) != 0 ||
         get_executable_name() != 0)
     {
         g_prepared = false;
-        return;
+        return false;
     }
 
-    if (!VM_Global_State::loader_env)
-        g_enabled = true;
-    else
-        g_enabled = get_boolean_property("vm.crash_handler", FALSE, VM_PROPERTIES);
-
     g_prepared = true;
+    return true;
+}
+
+
+void cleanup_gdb_crash_handler()
+{
+    STD_FREE(g_executable);
+    g_prepared = false;
 }

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/gdb_crash_handler.h (from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/crash_handler.h)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/gdb_crash_handler.h?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/gdb_crash_handler.h&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/crash_handler.h&r1=637971&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/include/crash_handler.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/include/gdb_crash_handler.h Tue Mar 18 04:31:02 2008
@@ -22,7 +22,7 @@
 #ifndef _CRASH_HANDLER_H
 #define _CRASH_HANDLER_H
 
-#include "vm_core_types.h"
+#include "open/platform_types.h"
 
 /**
  * \file
@@ -30,18 +30,16 @@
  */
 
 /**
- * Checks if gdb crash handler is enabled and prepared.
+ * Initializes the static state needed for gdb crash handler.
  *
- * @return true if gdb crash handler is enabled and ready for use.
+ * @return <code>true</code> on success or <code>false</code> on failure
  */
-bool is_gdb_crash_handler_enabled();
+bool init_gdb_crash_handler();
 
 /**
  * Initializes the static state needed for gdb crash handler.
- *
- * @return 0 on success or negative value on failure
  */
-void init_gdb_crash_handler();
+void cleanup_gdb_crash_handler();
 
 /**
  * Invokes gdb.

Copied: harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp (from r637971, harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/native_stack_os.cpp)
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp?p2=harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp&p1=harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/native_stack_os.cpp&r1=637971&r2=638327&rev=638327&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/linux/native_stack_os.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/crash_handler/linux/native_unwind_os.cpp Tue Mar 18 04:31:02 2008
@@ -17,11 +17,11 @@
 
 
 #include <pthread.h>
-#include "native_modules.h"
-#include "native_stack.h"
+#include "port_modules.h"
+#include "native_unwind.h"
 
 
-bool native_is_in_code(WalkContext* context, void* ip)
+bool native_is_in_code(UnwindContext* context, void* ip)
 {
     if (!ip)
         return false;
@@ -41,7 +41,7 @@
     return false;
 }
 
-bool native_get_stack_range(WalkContext* context, Registers* regs, native_segment_t* seg)
+bool native_get_stack_range(UnwindContext* context, Registers* regs, native_segment_t* seg)
 {
     int err;
     pthread_attr_t pthread_attr;



Mime
View raw message