MCPcopy Create free account
hub / github.com/cretz/stackparam / get_frame_params

Function get_frame_params

src/native.rs:487–508  ·  view source on GitHub ↗
(jni_env: *mut JNIEnv, thread: jthread, frame: &jvmtiFrameInfo, depth: jint)

Source from the content-addressed store, hash-verified

485}
486
487unsafe 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
510unsafe fn new_string(jni_env: *mut JNIEnv, str: &str) -> Result<jstring, String> {
511 let cstr = CString::new(str).unwrap();

Callers 1

get_paramsFunction · 0.85

Calls 4

get_method_param_infoFunction · 0.85
apply_local_var_tableFunction · 0.85
get_thisFunction · 0.85
get_local_varFunction · 0.85

Tested by

no test coverage detected