diff --git a/vm/vmcore/src/jvmti/jvmti.cpp b/vm/vmcore/src/jvmti/jvmti.cpp index 1565011..d4037d7 100644 --- a/vm/vmcore/src/jvmti/jvmti.cpp +++ b/vm/vmcore/src/jvmti/jvmti.cpp @@ -272,28 +272,18 @@ jint JNICALL create_jvmti_environment(Ja void DebugUtilsTI::setExecutionMode(Global_Env *p_env) { - const char *interp_property = - properties_get_string_property((PropertiesHandle)&p_env->properties, "vm.use_interpreter"); + for (int i = 0; i < p_env->vm_arguments.nOptions; i++) { + char *option = p_env->vm_arguments.options[i].optionString; - if (NULL != interp_property) - { - TRACE2("jvmti", "Interpreter property is already set on command line to value " << - interp_property); - } - else - for (int i = 0; i < p_env->vm_arguments.nOptions; i++) { - char *option = p_env->vm_arguments.options[i].optionString; - - if (!strncmp(option, "-agentlib:", 10) || - !strncmp(option, "-agentpath:", 11) || - !strncmp(option, "-Xrun", 5)) - { - TRACE2("jvmti", "Enabling EM JVMTI mode"); - // add_pair_to_properties(p_env->properties, "vm.use_interpreter", "true"); - add_pair_to_properties(p_env->properties, "vm.jvmti.enabled", "true"); - break; - } + if (!strncmp(option, "-agentlib:", 10) || + !strncmp(option, "-agentpath:", 11) || + !strncmp(option, "-Xrun", 5)) + { + TRACE2("jvmti", "Enabling EM JVMTI mode"); + add_pair_to_properties(p_env->properties, "vm.jvmti.enabled", "true"); + break; } + } } DebugUtilsTI::DebugUtilsTI() : diff --git a/vm/vmcore/src/jvmti/jvmti_locals.cpp b/vm/vmcore/src/jvmti/jvmti_locals.cpp index 4eba49e..306b76a 100644 --- a/vm/vmcore/src/jvmti/jvmti_locals.cpp +++ b/vm/vmcore/src/jvmti/jvmti_locals.cpp @@ -197,9 +197,14 @@ jvmtiGetLocalObject(jvmtiEnv* env, if (result == EXE_ERROR_NONE) { - ObjectHandle oh = oh_allocate_local_handle(); - oh->object = obj; - *value_ptr = oh; + if (NULL != obj) + { + ObjectHandle oh = oh_allocate_local_handle(); + oh->object = obj; + *value_ptr = oh; + } + else + *value_ptr = NULL; } tmn_suspend_enable(); @@ -447,16 +452,17 @@ jvmtiSetLocalObject(jvmtiEnv* env, GET_JIT_FRAME_CONTEXT; tmn_suspend_disable(); - ObjectHandle oh; + OpenExeJpdaError result; if (NULL != value) + result = jit->set_local_var(method, jfc, slot, + VM_DATA_TYPE_MP, &value->object); + else { - ObjectHandle obj = value; - oh = oh_allocate_local_handle(); - oh->object = obj->object; + ManagedObject *n = NULL; + result = jit->set_local_var(method, jfc, slot, + VM_DATA_TYPE_MP, &n); } - OpenExeJpdaError result = jit->set_local_var(method, jfc, slot, - VM_DATA_TYPE_MP, &oh); si_free(si); tmn_suspend_enable(); diff --git a/vm/vmcore/src/jvmti/jvmti_step.cpp b/vm/vmcore/src/jvmti/jvmti_step.cpp index c56a53c..27694d3 100644 --- a/vm/vmcore/src/jvmti/jvmti_step.cpp +++ b/vm/vmcore/src/jvmti/jvmti_step.cpp @@ -497,7 +497,9 @@ jvmtiError DebugUtilsTI::jvmti_single_st { VM_thread *vm_thread = get_vm_thread(ht); if( !vm_thread ) { - assert(!hythread_is_alive(ht)); + // Skip thread that isn't started yet. SingleStep state + // will be enabled for it in + // jvmti_send_thread_start_end_event continue; } @@ -564,7 +566,8 @@ jvmtiError DebugUtilsTI::jvmti_single_st { VM_thread *vm_thread = get_vm_thread(ht); if( !vm_thread ) { - assert(!hythread_is_alive(ht)); + // Skip thread that isn't started yet. No need to disable + // SingleStep state for it continue; } jvmti_remove_single_step_breakpoints(this, vm_thread);