(jni_env: *mut JNIEnv, thread: jthread, frame: &jvmtiFrameInfo, depth: jint)
| 485 | } |
| 486 | |
| 487 | unsafe fn get_frame_params(jni_env: *mut JNIEnv, thread: jthread, frame: &jvmtiFrameInfo, depth: jint) -> Result<MethodInfo, String> { |
| 488 | if log_enabled!(Trace) { trace!("Getting info for {}", method_name(frame.method)?); } |
| 489 | let mut method = get_method_param_info(frame.method)?; |
| 490 | let is_native = method.mods & 0x00000100 != 0; |
| 491 | if is_native { |
| 492 | trace!("Native method, not applying local table or getting values"); |
| 493 | } else { |
| 494 | trace!("Applying local table"); |
| 495 | apply_local_var_table(frame.method, &mut method)?; |
| 496 | } |
| 497 | // Apply the param values if we can get them |
| 498 | for param in method.params.iter_mut() { |
| 499 | trace!("Var named {} at slot {} has type {}", param.name, param.slot, param.typ); |
| 500 | // Now get the local var if we can |
| 501 | if param.slot == 0 && param.name == "this" { |
| 502 | param.val = Some(get_this(thread, depth)?); |
| 503 | } else if !is_native { |
| 504 | param.val = Some(get_local_var(jni_env, thread, depth, param.slot, param.typ.as_ref())?); |
| 505 | } |
| 506 | } |
| 507 | return Result::Ok(method); |
| 508 | } |
| 509 | |
| 510 | unsafe fn new_string(jni_env: *mut JNIEnv, str: &str) -> Result<jstring, String> { |
| 511 | let cstr = CString::new(str).unwrap(); |
no test coverage detected